-
-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
serverless fails with 'Cannot find module './fetch.node'' using IPFS #2480
Comments
Did you ever find a fix for this? I'm also having this error. |
anyone fixed this issue. I can build locally without any issue. but when I try to deploy it to vercel or was amplify, the node-fetch module is missing during deployment.... |
Hey i wanted to ask how you managed to run locally? do i have to configure my nextjs webpack or something? i seem to get the error even on my dev server in localhost |
I found a way out, use |
I put it in a component (use the IPFS module), then use the dynamic loading technique with const TestConnectLoad = () => import('../components/TestConnect/TestConnect')
const TestConnect = dynamic(TestConnectLoad, {ssr: false})
export default function Page() {
return (
<TestConnect />
)
} The error gone. |
Issue Summary
Executing 'serverless' command fails with 'Error: Cannot find module './fetch.node' for webpack when using IPFS module.
Actual behavior
Created new repo via 'npx create-next-app@latest'
Imported ipfs-http-client
Added 'serverless.yml'
setup simple connection to an ipfs provider in index.js
executed npm run build => no issues
executed serverless => error
Expected behavior
Steps to reproduce
https://github.com/tmaus/serverless-nextjs-ipfs
Screenshots/Code/Configuration/Logs
Versions
MacOS (12.4)
node: 16.1.0
npm 8.15.0
next: 12.2.8
react: 18.2.0
Additional context
Stumbled upon it on a bigger project. Assume its webpack related but was not able to overcome it after a couple of days trying.
Checklist
latest
oralpha
@sls-next/serverless-component
release version, which may have already fixed your issue or implemented the feature you are trying to use. Note that the oldserverless-next.js
component and theserverless-next.js
plugin are deprecated and no longer maintained.thanks for your help
The text was updated successfully, but these errors were encountered: