Export default is not supported in latest rescript compiler


I had an unexpected error after upgrading the rescript compiler to v9.0.1 from v8.3.1. I found the error caused by missing export default in *.bs.js file. The configuration of bsconfig.json is es6. (My project is storybook with ReasonReact.)

bs-platform v8.3.1

export {
  ... ,
  $$default ,
  $$default as default,

bs-platform v9.0.1

export {
  ... ,
  make ,

I’ve read Changes.md(https://github.com/rescript-lang/rescript-compiler/blob/master/Changes.md), but couldn’t find something related. But I found that I should add default to export to JS.(https://rescript-lang.org/docs/manual/latest/import-from-export-to-js#export-an-es6-default-value)

I think that export default is needed along with ESM spec. I’m wondering why the exporting as default is not supported in the latest rescript compiler.

Totally my mistake. It is not caused by the difference of bs-platform version, but source codes like always :smile: Export default is not supported in latest rescript compiler

Can you show the input source code?

Totally my mistake. Actually, I have two different projects which are using different bs-platform version(v8.3.1, v9.0.1) Therefore I thought it was caused by the difference between bs-platform version. But I realized and found let default = make in long lines of my source code which is using bs-platform v8.3.1. That causes the different export, not bs-platform.