Closed Skyfiir78 closed 1 year ago
I managed to resolve this issue. It turned out that it was related to how Webpack handles .mjs
files.
Here are the steps I followed to fix the issue:
I added a rule to my Webpack configuration to handle .mjs
files.
I also cleaned my package manager's cache and removed the node_modules
directory to ensure a clean installation of dependencies.
Here's an example of the rule added to the Webpack configuration through Craco:
webpack: {
configure: (webpackConfig) => {
webpackConfig.module.rules.push({
test: /\.mjs$/,
include: /node_modules/,
type: "javascript/auto",
});
return webpackConfig;
},
},
And here are the commands used to clean the cache and reinstall dependencies:
For npm:
npm cache clean --force
rm -rf node_modules
npm install
For yarn:
yarn cache clean
rm -rf node_modules
yarn install
After following these steps, the issue was resolved and the application started without any issues.
I hope this will help others who encounter the same problem.
Thanks man, this is really helpful!
I followed the instructions in the documentation to use
react-use-intercom
, but I encounter a compilation error stating: "Can't import the named export 'createContext' from non EcmaScript module (only default export is available)".Steps to Reproduce
react-use-intercom
usingnpm install react-use-intercom
.react-use-intercom
in my code as suggested in the documentation.Here is the code snippet I used:
Expected Behavior The project should compile without errors and use
react-use-intercom
as per the instructions in the documentation.Environment
react-use-intercom
Version: 5.1.4Thank you for helping me resolve this issue.