Closed gabrielvieiraes closed 11 months ago
Your ticket does not provide sufficient details to troubleshoot your issue. Why don't you start by describing your environment? (Node version, React version, framework / build toolchain version, etc.)
Node - v16.20.0 React - ^16.12.0 craco/craco - ^5.6.2 Mantine - 6.0.19
And what is your react-scripts
(CRA) version?
"react-scripts": "^3.2.0"
This is really outdated CRA version. Upgrading to react-scripts@^5
should resolve the error you are seeing - https://stackoverflow.com/a/72959074
To resolve this issue in CRA 3 / CRA 4 environment, you can force the webpack to use CJS version of this library instead of ESM. Here is an example using @craco/craco@5
:
// craco.config.js
const path = require("path");
module.exports = {
webpack: {
alias: {
"react-photo-album": path.resolve(
__dirname,
"node_modules/react-photo-album/dist/index.js",
),
},
},
};
Describe the bug
Failed to compile.
Expected behavior
Project does not compile when I try to use PhotoAlbum
How to reproduce
Screenshots / Logs
No response
Additional context
No response