Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken build with in-source compilation #39

Open
rusty-key opened this issue Jan 9, 2019 · 1 comment
Open

Broken build with in-source compilation #39

rusty-key opened this issue Jan 9, 2019 · 1 comment

Comments

@rusty-key
Copy link

After trying to use reductive in a fresh project, I experienced this runtime error:

Uncaught TypeError: f.apply is not a function
    at app (curry.js:12)
    at curry_2 (curry.js:131)
    at Module._2 (curry.js:143)
    at Module.element (ReasonReact.js:538)
    at Module../src/index.re (index.re:14)
    at __webpack_require__ (bootstrap:782)
    at fn (bootstrap:150)
    at Object.0 (thunkedStore.re:58)
    at __webpack_require__ (bootstrap:782)
    at checkDeferredModules (bootstrap:45)
    at Array.webpackJsonpCallback [as push] (bootstrap:32)
    at main.chunk.js:1

The problem only occurs if I use in-source compilation. If I switch to in-source: false, it works perfectly fine.

After a bit of digging, I noticed that reductive depends on two versions of bs-platform:
https://github.com/reasonml-community/reductive/blob/d9903eb7a128edfa097f42d970c73775e9d24bd6/yarn.lock#L419-L427
one of which is a dependency of immuatable-re:
https://github.com/reasonml-community/reductive/blob/d9903eb7a128edfa097f42d970c73775e9d24bd6/yarn.lock#L1236-L1240
https://github.com/facebookincubator/immutable-re/blob/master/package.json#L39

I've tried to patch version and looks like it solves the problem:
facebookarchive/immutable-re@master...rusty-key:bs-platform
master...rusty-key:bs-platform

Here are "minimal" examples:
https://github.com/rusty-key/reductive-broken-compilation-example/

Because of very experimental state of immutable-re I am not sure if this upgrade will not break something but I submitter PR anyway:
facebookarchive/immutable-re#103

@rickyvetter, what do you think?

@rickyvetter
Copy link
Owner

Thanks for submitting a PR on immutable-re! I think we can probably move to use Belt data structures if you want a fix that doesn't depend on another repo. Belt is more stable, is actively supported, and doesn't introduce a new dependency since it ships with bs-platform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants