Since adding an additional backend environment, I see the following compilation error when running npm start: -
./node_modules/@aws-amplify/datastore/lib-esm/datastore/datastore.js
Attempted import error: 'immerable' is not exported from 'immer'.
This is on a Windows 10 machine running from command prompt, both regular and with admin rights. It has worked fine in the past, running the development server as normal. I haven't made any changes to the Amplify configuration that worked previously.
If I run npm start from a Git Bash terminal it works fine.
System:
OS: Windows 10 10.0.18363
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 16.09 GB / 31.74 GB
Binaries:
Node: 12.16.1 - C:\Program Files\nodejs\node.EXE
npm: 6.13.4 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: 44.18362.449.0
Internet Explorer: 11.0.18362.1
npmGlobalPackages:
@aws-amplify/cli: 4.18.0
same
@pnm563 upgrade node (to 12.8.2) helped for me
Seems it has to o with datastore even when datastore is not added to the project through amplify cli. Install @aws-amplify/datastore and it should work again
This didn't do anything. However, changing the imported immerable in the specified file to upper case did. Like that:
import { Immerable, produce, setAutoFreeze } from 'immer';
For those, who have this issue, you probably have multiple installed versions (you might want to check your lock files) of:
In short, the issue is with the package manager improperly hoisting dependencies, not amplify.
To fix this issue on yarn, just add the version of immer to your package.json, at the moment of writing, it is:
yarn add [email protected]
hi @pnm563 - sorry for the delay. After taking a look, it doesn't seem to be an issue on the Amplify side. It looks like @o-alexandrov has a reasonable fix. You might need to open an issue with the immer library. Thank you!
Most helpful comment
hi @pnm563 - sorry for the delay. After taking a look, it doesn't seem to be an issue on the Amplify side. It looks like @o-alexandrov has a reasonable fix. You might need to open an issue with the
immerlibrary. Thank you!