-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Module not found: Can't resolve 'encoding' './node_modules/node-fetch/lib/index.js' #7621
Comments
@brookton The build is showing a warning about You may need custom routes to handle the |
This comment has been minimized.
This comment has been minimized.
@samuelcastro doing that means you're bundling server-only dependencies and shipping them to the browser, so in general I wouldn't recommend adding that config. |
Ok @timneutkens , so how do you suggest to fix it then? I can't deploy with |
@samuelcastro does the deployment error? Because it shouldn't be. |
@timneutkens Yes, deployment in failing on |
nvm, seems to be ok now, it was not deploying with this error but it might be something else. |
Hi, this exact error is happening on my production app, any fixes for it, I am running [email protected] |
Deleting .next folder fixes similar problems. |
`./node_modules/next/dist/next-server/server/load-components.js ./node_modules/next/dist/next-server/server/load-components.js ./node_modules/next/dist/next-server/server/require.js ./node_modules/next/dist/next-server/server/require.js ./node_modules/next/dist/next-server/server/require.js ./node_modules/node-fetch/lib/index.js i got these warnings on production build ! |
yarn add -D encoding seems to resolve the encoding reference, but still seeing the other warnings above here. More reading: |
What solved it for me was doing both things users above me proposed.
Hope that will be the case for you too 🤞🏼 |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
After downloading the Tutorial from git clone https://github.com/zeit/next-learn-demo.git
cd next-learn-demo
cd 7-styling-components
then following ZEIT Now deployment procedures as outlined in the tutorial:
https://nextjs.org/learn/basics/deploying-a-nextjs-app/run-two-instances
Describe the bug
Unable to run
npm run build
across multiple projects and enviornments.
Build compiles with warnings when isomorphic-unfetch is called.
Unable to deploy ZEIT Now.
A clear and concise description of what the bug is.
To Reproduce
NPM v: 6.9.0
NODE v: 12.4.0
NEXT.js v: 8.1.0
Mac OS
VS Code Terminal
Steps to reproduce the behavior, please provide code snippets or a repository:
"build": "next build",
"now-build": "next build",
"start": "next start"
},
module.exports = {
target: 'serverless'
};
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/next" }]
}
ERROR
`Compiled with warnings.
./node_modules/node-fetch/lib/index.js
Module not found: Can't resolve 'encoding' in '/Users/Documents/next-learn-demo/7-styling-components/node_modules/node-fetch/lib'
┌ /
├ /_app
├ /_document
├ /_error
├ /about
└ /post`
Expected behavior
compiling successfully.
Only happens when API key is involved
Began happening last night, have been attempting work arounds all day with no resolve
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
System information
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: