Open PatrickAlphaC opened 2 years ago
I also had the same warning and you need to manually install these dependencies:
yarn addd magic-sdk
@walletconnect/web3-provider
yarn add moralis
then the error goes away. Maybe its because of these packages are in the devDependency of react-moralis. Hopefully this will be fixed in the future.
These dependencies are optional dependencies, so if you don't need them, then you don't have to install them.
The warning messages have been filtered out in a recent release.
I'm using "moralis": "^1.3.1" and "react-moralis": "^1.3.0" but it is still throwing those dependency errors and crashes a nextJS project
I see, it seems that the error messages still show up in NextJs. Re-opnening this issue for future references.
I started a new NextJs project as described above and see those messages as well in the terminal.
But the app does not crash for me. These are warning messages (due to the limitations of our current build process in the sdk and the fact that we cannot handle optional dependencies very good), but this will not crash the app.
Ideally we want to not show these warnings, but I'm not sure if it is possible with out current build setup for the SDK. This will be solved in the next major release of the SDK (as we are restructuring the architecture and building to be more flexible and modern)
Currently the best solution is:
Or if you know a way on how to surpress certain warning messages in NextJs, then please let me know.
I'm using "moralis": "^1.3.1" and "react-moralis": "^1.3.0" but it is still throwing those dependency errors and crashes a nextJS project
The fact that the app crashes, might be because of another error, please check if you have other errors and if the same thing happens with a clean/new project
@ErnoW Actually you are right it does not crash the nextJS server. Sorry fo the false alarm :sweat_smile:
Since these are optional dependencies and these warnings comes from Webpack 5 (in Next.js v. 12 the support for Webpack 4 was removed) I've got rid of them by customising webpack config in next.config.js as follow:
module.exports = {
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
config.ignoreWarnings = [
{
message: /(magic-sdk|@walletconnect\/web3-provider|@web3auth\/web3auth)/,
}
]
return config
},
}
Hello,
I also have this issue, but I'm not using NextJS, only classic React.
This solved the issue for me on Next.js
yarn add magic-sdk @walletconnect/web3-provider @web3auth/web3auth
install the xcode
New Bug Report
WIth a new nextjs project, running
yarn dev
ornpm run dev
results in immediate warnings:Checklist
Issue Description
Then, update your
_app.js
file to look something like:Then run:
And you'll see the warnings. If you go ahead and add that package, you then get it complaining about not finding
@walletconnect/web3-provider
Actual Outcome
Expected Outcome
No warnings
Environment
macos Monterey 12.1 yarn: 1.22.17
Server - N/A