[SOLVED] ReasonML and Meteor

I’m trying to setup Meteor with reasonml on the server. I assumed that it should work without writing a meteor-package to compile bs/re to js.

Currently I’m building the project with bsb -make-world and sym-link the output lib/js/src/ to meteors imports folder. It works fine. But when I use a reason module like List. Then I get the following error:

W20180226-16:34:26.466(1)? (STDERR) Error: Cannot find module './curry.js'
W20180226-16:34:26.467(1)? (STDERR)     at makeMissingError (packages/modules-runtime.js:231:12)
W20180226-16:34:26.467(1)? (STDERR)     at require (packages/modules-runtime.js:241:19)
W20180226-16:34:26.467(1)? (STDERR)     at list.js (packages/modules.js:329:13)
W20180226-16:34:26.468(1)? (STDERR)     at fileEvaluate (packages/modules-runtime.js:343:9)
W20180226-16:34:26.468(1)? (STDERR)     at require (packages/modules-runtime.js:238:16)
W20180226-16:34:26.468(1)? (STDERR)     at Foo.bs.js (imports/Bar/Foo.bs.js:4:12)
W20180226-16:34:26.469(1)? (STDERR)     at fileEvaluate (packages/modules-runtime.js:343:9)
W20180226-16:34:26.469(1)? (STDERR)     at require (packages/modules-runtime.js:238:16)
W20180226-16:34:26.469(1)? (STDERR)     at main.js (server/main.js:1:28)
W20180226-16:34:26.470(1)? (STDERR)     at fileEvaluate (packages/modules-runtime.js:343:9)

Other notes:

  • I have installed the bs-platform package
  • It works fine with a pure node project

It works when the reason code is built inside of the meteor project without sym-linking.

2 Likes

What is your workflow in regards to buildng front-end?
Reason supports hot module replacement - does it not? Whereas Meteor reloads the page fully.
Do you somehow use HMR?

I have not looked into HMR with reason yet because there is no need for it in my current projects.