Closed Yimaha closed 3 years ago
Thanks for reporting. We have not encountered this yet and will need to investigate further.
So, our team (in particular one of the team member whose name start with F) figured out that it was the issue with craco config.
We also found a similar post on stack-overflow that seems to be caused by a similar issue,
we answered how we fixed it there
@Yimaha Thank you for the update. We close the issue as we believe your stack overflow post is the best answer.
How frequently does the bug occur?
All the time
Description
We tried to follow through this tutorial with all the correct version and stuff
> https://docs.mongodb.com/realm/sdk/node/integrations/electroncra/What we realized is that, it works, yes, that nice, but if we introduce any sort of state management, for example, modify the App.js as follow:
the application will no longer compile, and it gives this error:
Uncaught Error: Must use import to load ES Module: /mnt/502476F92476E180/test2/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js require() of ES modules is not supported. require() of /mnt/502476F92476E180/test2/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js from /mnt/502476F92476E180/test2/build/index.html is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules. Instead rename arrayWithHoles.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /mnt/502476F92476E180/test2/node_modules/@babel/runtime/helpers/esm/package.json.
which is weird, I cannot find any documentation about this online, did someone encountered this before?
Stacktrace & log output
No response
Can you reproduce the bug?
Yes, always
Reproduction Steps
Just follow through the tutorial and add a state
on Ubuntu 20.04, node.js version 10.19.0, npm version 6.14.15
Version
13.2.1
What SDK flavour are you using?
Local Database only
Are you using encryption?
No, not using encryption
Platform OS and version(s)
Ubuntu 20.04
Build environment
Which debugger for React Native: ..