Support Forums

NextJS error during deployment

PLEASE help us help you by writing a good post!

Name of my site is

This is the error I get and Essential NextJS plugin by netlify is apparently installed on dazzling-fermi-20b625

2:30:35 PM: ────────────────────────────────────────────────────────────────
2:30:35 PM:   4. Functions bundling                                         
2:30:35 PM: ────────────────────────────────────────────────────────────────
2:30:35 PM: ​
2:30:35 PM: Packaging Functions from .netlify/functions-internal directory:
2:30:35 PM:  - next_api_hello/next_api_hello.js
2:30:35 PM:  - next_image/next_image.js
2:30:35 PM:  - next_index/next_index.js
2:30:35 PM:  - next_posts_slug/next_posts_slug.js
2:30:35 PM: ​
2:30:39 PM: ​
2:30:39 PM: ────────────────────────────────────────────────────────────────
2:30:39 PM:   Dependencies installation error                               
2:30:39 PM: ────────────────────────────────────────────────────────────────
2:30:39 PM: ​
2:30:39 PM:   Error message
2:30:39 PM:   A Netlify Function failed to require one of its dependencies.
2:30:39 PM:   Please make sure it is present in the site's top-level "package.json".
2:30:39 PM:   In file "/opt/build/repo/.netlify/functions-internal/next_index/next_index.js"
2:30:39 PM:   Cannot find module '../webpack-runtime.js' from '/opt/build/repo/.netlify/functions-internal/next_index/nextPage/pages'
2:30:39 PM: ​
2:30:39 PM:   Resolved config
2:30:39 PM:   build:
2:30:39 PM:     command: yarn build
2:30:39 PM:     commandOrigin: ui
2:30:39 PM:     publish: /opt/build/repo/out
2:30:39 PM:     publishOrigin: ui
2:30:39 PM:   functions:
2:30:39 PM:     '*':
2:30:39 PM:       included_files:
2:30:39 PM:         - '!node_modules/@next/swc-*/**/*'
2:30:39 PM:         - '!node_modules/next/dist/compiled/@ampproject/toolbox-optimizer/**/*'
2:30:39 PM:   headers:
2:30:43 PM:     - for: /_next/static/chunks/*

Hey there, @iJKTen :wave:

Thanks for reaching out! Can you share your repo with us? This will help us look into your package.json and setup. Additionally, it says “a Netlify Function failed to require one of its dependencies”. Can you share your function name that you are using as well?

Thanks :slight_smile:

Is there a solution to this? I am currently facing the same issue

@hillary sure. Here it is GitHub - iJKTen/plastic-free: My friend Jai on being plastic free

I have no idea about a function name…

This would help:

I tried adding the tool file but it failed. It’s okay, I got it working on Vercel.