Linting error with Moralis react

Hi,
I am doing some codebase clean up and this warning :
./node_modules/magic-sdk/dist/es/index.js
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

./node_modules/magic-sdk/dist/es/index.js
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

Is coming from the magic-link integration with node.js moralis integration module.

It seems to be related to particular version of packages. Do you have recommendation to fix this? I do not want to have to ignore warnings in production deployed packages.

what version of magic sdk did you install, I think that it works with version 7

here is the section of my package-lock
“node_modules/@magic-sdk/commons”: {
“version”: “4.1.1”,
“resolved”: “https://registry.npmjs.org/@magic-sdk/commons/-/commons-4.1.1.tgz”,
“integrity”: “sha512-nHbMRkssAC1z5rHpPwkiYolp3qxmtnkNaynGlreVxgtPTemJ8USRrXjg/cF0WVhRwtPTpegdTvtpJWOMd0Ratg==”,
“peerDependencies”: {
@magic-sdk/provider”: “>=4.3.0”,
@magic-sdk/types”: “>=3.1.1”
}
},
“node_modules/@magic-sdk/provider”: {
“version”: “8.1.1”,
“resolved”: “https://registry.npmjs.org/@magic-sdk/provider/-/provider-8.1.1.tgz”,
“integrity”: “sha512-1t/BJxnd1PTdrw6J0s4kBvZot9tJ9z+Tm+It2doiO3HnyRWZuIoXjXTVoX/sUZQPlsRk/E7Ut7NY9yUTdApeZw==”,
“dependencies”: {
@magic-sdk/types”: “^7.1.1”,
“eventemitter3”: “^4.0.4”,
“web3-core”: “1.5.2”
},

dependencies says “magic-sdk”: “^8.0.1”,

Should that package be installed by Moralis ‘npm install’?

try to install magic-sdk version 7, it may not work well with version 8

1 Like

7.0.0 seems to fix this issue yes.