Skip to content

Broken build with in-source compilation #39

@rusty-key

Description

@rusty-key

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions