dusty-phillips / rescript-zora

Lightning-fast testing for a lightning-fast compiler
MIT License
52 stars 11 forks source link

`Promise.catch` es6 issue #1

Closed renovatorruler closed 3 years ago

renovatorruler commented 3 years ago

Trying to figure out why exposing Promise.catch in the rescript-zora library or even calling Promise.catch in my own code gives that es6 module error.

https://github.com/ryyppy/rescript-promise/issues/15#issuecomment-891059065

dusty-phillips commented 3 years ago

Sorry for taking a while to respond. I was able to reproduce it with the default configuration I had before.

My experience has been that rescript-promise works best with node when setting the suffix to .mjs and the package.json type to module. (If you make this change, make sure to run npx rescript build -with-deps to force it to recompile the promise library in mjs)

I've updated the suggested configuration in the READMe to reflect this, and added an example of this working here.

However, I'd much rather have full support for both es6 and common-js, and would be ever-so-grateful for a PR that solves it.

dusty-phillips commented 3 years ago

I believe cjs is working now.