We are looking at using this library for our project and it looks really promising, especially with the fluid drag to enlarge.
However, when I try to install the package into a JS-only React project, I am met with the following error:
Failed to compile.
./node_modules/@remotelock/react-week-scheduler/index.mjs
Can't import the named export 'createContext' from non EcmaScript module (only default export is available)
I copied the code from the sample in the Readme to produce this error
This seems to be an issue related to breaking changes in webpack and how it treats .mjs files as listed here
And a dirty fix appears to be something along the following, as discussed here
{
type: 'javascript/auto',
test: /\.mjs$/,
use: []
}
Edit
This appears to be an issue with create-react-app and the default webpack config it's using, as it will not support .mjs extensions until jest does.
So is there any plan to support projects bootstrapped with create-react-app without ejecting?
We are looking at using this library for our project and it looks really promising, especially with the fluid drag to enlarge.
However, when I try to install the package into a JS-only React project, I am met with the following error:
I copied the code from the sample in the Readme to produce this error
This seems to be an issue related to breaking changes in webpack and how it treats.mjsfiles as listed hereAnd a dirty fix appears to be something along the following, as discussed hereEdit
This appears to be an issue with
create-react-appand the default webpack config it's using, as it will not support.mjsextensions until jest does.So is there any plan to support projects bootstrapped with
create-react-appwithout ejecting?