Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A Netlify Function failed to require one of its dependencies. #803

Answered by twlite
twlite asked this question in Q&A
Discussion options

Hello, I started getting this error out of nowhere from today. It was working fine but it suddenly stopped working since last deploy.
While building, it throws:

5:15:45 PM: > .netlify/functions-internal/next_api/nextPage/pages/api.js:166:34: error: Could not resolve "../webpack-runtime.js"
5:15:45 PM: 166  var __webpack_require__ = require("../webpack-runtime.js");
5:15:45 PM:  ~~~~~~~~~~~~~~~~~~~~~~~
5:15:46 PM: ​
5:15:46 PM: ────────────────────────────────────────────────────────────────
5:15:46 PM: Dependencies installation error 
5:15:46 PM: ────────────────────────────────────────────────────────────────
5:15:46 PM: ​
5:15:46 PM: Error message
5:15:46 PM: A Netlify Function failed to require one of its dependencies.
5:15:46 PM: Please make sure it is present in the site's top-level "package.json".
​
5:15:46 PM: Build failed with 1 error:
5:15:46 PM: .netlify/functions-internal/next_api/nextPage/pages/api.js:166:34: error: Could not resolve "../webpack-runtime.js"

I tried building my site locally as well but it throws same error.

After looking at the file .netlify/functions-internal/next_api/nextPage/pages/api.js:166:34, looks like it's trying to require ../webpack-runtime.js but there's a file webpack-api-runtime.js instead 🤔

default

image

after changing

image

You must be logged in to vote

This issue was fixed after removing lockfile & running yarn add -D @netlify/plugin-nextjs@beta
Looks like something messed up with the installation of @netlify/plugin-nextjs which caused this problem

Replies: 2 comments 2 replies

Comment options

This issue was fixed after removing lockfile & running yarn add -D @netlify/plugin-nextjs@beta
Looks like something messed up with the installation of @netlify/plugin-nextjs which caused this problem

You must be logged in to vote
0 replies
Answer selected by twlite
Comment options

This issue is that you still have the functions from the old version of the plugin. You should delete .netlify/functions-internal and rebuild. The next beta will check and warn for this.

You must be logged in to vote
2 replies
Comment options

This issue is that you still have the functions from the old version of the plugin. You should delete .netlify/functions-internal and rebuild. The next beta will check and warn for this.

@ascorbic How do we delete this ? Don't see controls for this on the Netlify admin panel

Comment options

Clear the cache and deploy. If you have any next_ functions committed to netlify/functions then they should be deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /