-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Netlify deploy failing when trying to bundle functions #1859
Comments
I finally got it working by just adding a bunch of packages to my |
@felixakiragreen Please reopen this issue, I believe its something that needs to be addressed. I'm getting the same issue. It appears the Netlify adapter is including some dependencies in the build output which are not being included in the output |
I'm getting this issue as well. The generated Netlify function ( Current workaround: Update |
These were all the packages I had to add to get Netlify to be happy "dependencies": {
"@lukeed/uuid": "^2.0.0",
"bufferutil": "^4.0.3",
"cookie": "^0.4.1",
"supports-color": "^9.0.2",
"utf-8-validate": "^5.0.5"
}, |
I'm having this issue as well, but the problem I'm seeing is different. I have have set the NODE_VERSION to 14. But it appears to be using Node 12 in Functions bundling: 8:54:49 AM: ────────────────────────────────────────────────────────────────
8:54:49 AM: 2. Functions bundling
8:54:49 AM: ────────────────────────────────────────────────────────────────
8:54:49 AM:
8:54:49 AM: Packaging Functions from .netlify/functions-internal directory:
8:54:49 AM: - __render.js
8:54:49 AM:
8:54:51 AM:
8:54:51 AM: ────────────────────────────────────────────────────────────────
8:54:51 AM: Internal error during "Functions bundling"
8:54:51 AM: ────────────────────────────────────────────────────────────────
8:54:51 AM:
8:54:51 AM: Error message
8:54:51 AM: Error: readdirp: root argument is required. Usage: readdirp(root, options)
8:54:51 AM:
8:54:51 AM: Error location
8:54:51 AM: During Functions bundling
8:54:51 AM: at readdirp (/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/node_modules/readdirp/index.js:262:11)
8:54:51 AM: at /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/node_modules/readdirp/index.js:276:5
8:54:51 AM: at new Promise (<anonymous>)
8:54:51 AM: at Function.readdirpPromise [as promise] (/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/node_modules/readdirp/index.js:274:10)
8:54:51 AM: at hasFunctionRootFile (/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/src/plugins_core/functions/error.js:119:32)
8:54:51 AM: at lacksNodeModules (/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/src/plugins_core/functions/error.js:111:12)
8:54:51 AM: at getModuleNotFoundMessage (/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/src/plugins_core/functions/error.js:50:43)
8:54:51 AM: at getModuleNotFoundErrorObject (/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/src/plugins_core/functions/error.js:41:25)
8:54:51 AM: at getModuleNotFoundErrorFromZISI (/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/src/plugins_core/functions/error.js:91:10)
8:54:51 AM: at getModuleNotFoundError (/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/src/plugins_core/functions/error.js:27:31) |
I'm getting the same error as @robhicks, and it doesn't seem to be the same error as the others. Should we open another issue? |
Can confirm I'm getting the same issue. Build is failing with a I tried switching the |
Adapter has issues: sveltejs/kit#1859 Vercel does not support Yarn 2 for SSR and functions
I'm now facing the same issue. After many successful deploys, my site is now failing due to missing deps for Temporary workaround is to manually install the 'missing' deps until it succeeds, per @felixakiragreen; hardly ideal tho 😏 |
For me it's even worse because the error log doesn't name any specific packages:
Any ideas how to work around this or what could be missing? I tried adding the packages mentioned here to my package.json but this doesn't resolve the issue. If I run the build locally, it's successful but I get warnings like these:
€: Solved, kind of. I had a |
To anyone still subscribed to this issue, I got in touch with netlify support and they recommended me add this to my [build]
command = "npm run build"
publish = "build"
[functions]
node_bundler = "esbuild" that last part, Hope this helps! |
The Netlify adapter has changed a lot since this issue was originally opened. There are several comments on this thread, but no clear way to reproduce the issue. As a result, I'm going to go ahead and close this. If you're still having problem, please file a new issue and provide a GitHub repository of a failing project and I'll take a look. |
Describe the bug
When trying to deploy to Netlify the build fails at the step: "2. Functions bundling"
yarn dev
,yarn build
,yarn run preview
,netlify dev
all work with no issues, it only happens when I try to deploy.Logs
To Reproduce
I am using the latest versions: (hardcoded into package.json to prevent issues)
Expected behavior
I expect it to deploy. I have deployed 3 svelte-kit to netlify, so this isn't my first rodeo. However, they were with previous versions:
"@sveltejs/adapter-netlify": "1.0.0-next.12"
& "@sveltejs/adapter-netlify": "1.0.0-next.14"`I tried adding the plugin, but it didn't help.
Stacktraces
If you have a stack trace to include, we recommend putting inside a
<details>
block for the sake of the thread's readability:Stack trace
8:27:57 PM: Require stack:
8:27:57 PM: - /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/node_modules/@netlify/zip-it-and-ship-it/src/node_dependencies/resolve.js
8:27:57 PM: - /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/node_modules/@netlify/zip-it-and-ship-it/src/node_dependencies/index.js
8:27:57 PM: - /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/node_modules/@netlify/zip-it-and-ship-it/src/main.js
8:27:57 PM: - /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/src/plugins_core/functions/index.js
8:27:57 PM: - /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/src/commands/get.js
8:27:57 PM: - /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/src/core/main.js
8:27:57 PM: - /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/src/core/bin.js
8:27:57 PM:
8:27:57 PM: Resolved config
8:27:57 PM: build:
8:27:57 PM: base: /opt/build/repo/frontend
8:27:57 PM: command: yarn build
8:27:57 PM: commandOrigin: config
8:27:57 PM: environment:
8:27:57 PM: - NODE_VERSION
8:27:57 PM: publish: /opt/build/repo/frontend/build
8:27:57 PM: publishOrigin: config
8:27:57 PM: functionsDirectory: /opt/build/repo/frontend/functions
8:27:57 PM: redirects:
8:27:57 PM: - from: /*
path: /*
status: 200
to: /.netlify/functions/render
Information about your SvelteKit Installation:
Diagnostics
OS: macOS 11.5
CPU: (8) arm64 Apple M1
Memory: 245.63 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.1.0 - ~/.nvm/versions/node/v16.1.0/bin/node
Yarn: 1.22.10 - /opt/homebrew/bin/yarn
npm: 7.11.2 - ~/.nvm/versions/node/v16.1.0/bin/npm
Browsers:
Chrome: 91.0.4472.114
Firefox: 80.0
Safari: 14.1.2
npmPackages:
@sveltejs/adapter-netlify: ^1.0.0-next.19 => 1.0.0-next.19
@sveltejs/kit: ^1.0.0-next.19 => 1.0.0-next.123
svelte: ^3.34.0 => 3.38.3
Severity
I'm completely blocked from being able to deploy my website. I was really hoping to get it done tonight, but now I'm stuck. I have a hard launch in a week, and I'm stuck.
The text was updated successfully, but these errors were encountered: