Open jhechtf opened 11 months ago
You need to provide a confined reproducible repl, you can't just provide your entire app and expect the svelte team to troubleshoot for you 😢
You've even said yourself the issues look related to the pg
package? Have you tried to migrate back to the postgres
package and see if that works?
what caused me to try the move to pg was the fact that it was happening with the postgres package.
Also stated is that reverting the upgrade to sveltekit2, even with the pg
package, deploys to vercel successfully, as linked in the issue.
Went to make a more refined down example repo, and ran into something different but possibly still connected, documenting here.
npm run build
. Like it says it transforms some modules, but hangs the terminal after that, no idea why as nothing ever gets displayed.drizzle-orm
, pg
, and some generic queries to a postgres db to make the npm run dev
command happy, and to actually use the db client in case that provided me a false positive. Installed @sveltejs/adapter-vercel
, set it up on the svelte.config.js
and ran npm run build
and it worked perfectlypnpm
(which is what i normally use) and ran pnpm build
. This failed with the following errors:> Using @sveltejs/adapter-vercel
Warning: The following modules failed to locate dependencies that may (or may not) be required for your app to work:
node_modules\.pnpm\pg@8.11.3\node_modules\pg\lib\native\client.js
- pg-native
error during build:
Error: EPERM: operation not permitted, symlink '.pnpm\pg@8.11.3\node_modules\pg' -> 'C:\Users\Jim\projects\vercel-adapter-breaking\.vercel\output\functions\fn.func\node_modules\pg'
at Object.symlinkSync (node:fs:1801:11)
at create_function_bundle (file:///C:/Users/Jim/projects/vercel-adapter-breaking/node_modules/.pnpm/@sveltejs+adapter-vercel@4.0.3_@sveltejs+kit@2.0.6/node_modules/@sveltejs/adapter-vercel/index.js:524:7)
at async generate_serverless_function (file:///C:/Users/Jim/projects/vercel-adapter-breaking/node_modules/.pnpm/@sveltejs+adapter-vercel@4.0.3_@sveltejs+kit@2.0.6/node_modules/@sveltejs/adapter-vercel/index.js:80:5)
at async adapt (file:///C:/Users/Jim/projects/vercel-adapter-breaking/node_modules/.pnpm/@sveltejs+adapter-vercel@4.0.3_@sveltejs+kit@2.0.6/node_modules/@sveltejs/adapter-vercel/index.js:246:5)
at async adapt (file:///C:/Users/Jim/projects/vercel-adapter-breaking/node_modules/.pnpm/@sveltejs+kit@2.0.6_@sveltejs+vite-plugin-svelte@3.0.1_svelte@4.2.8_vite@5.0.10/node_modules/@sveltejs/kit/src/core/adapt/index.js:37:2)
at async finalise (file:///C:/Users/Jim/projects/vercel-adapter-breaking/node_modules/.pnpm/@sveltejs+kit@2.0.6_@sveltejs+vite-plugin-svelte@3.0.1_svelte@4.2.8_vite@5.0.10/node_modules/@sveltejs/kit/src/exports/vite/index.js:825:7)
at async Object.handler (file:///C:/Users/Jim/projects/vercel-adapter-breaking/node_modules/.pnpm/@sveltejs+kit@2.0.6_@sveltejs+vite-plugin-svelte@3.0.1_svelte@4.2.8_vite@5.0.10/node_modules/@sveltejs/kit/src/exports/vite/index.js:855:5)
at async PluginDriver.hookParallel (file:///C:/Users/Jim/projects/vercel-adapter-breaking/node_modules/.pnpm/rollup@4.9.1/node_modules/rollup/dist/es/shared/node-entry.js:18561:17)
at async Object.close (file:///C:/Users/Jim/projects/vercel-adapter-breaking/node_modules/.pnpm/rollup@4.9.1/node_modules/rollup/dist/es/shared/node-entry.js:19491:13)
at async build (file:///C:/Users/Jim/projects/vercel-adapter-breaking/node_modules/.pnpm/vite@5.0.10/node_modules/vite/dist/node/chunks/dep-R0I0XnyH.js:66825:13)
ELIFECYCLE Command failed with exit code 1.
^3.0.0
of the @sveltejs/adapter-vercel
and 4.0.3
, both fail with the same errors. Were you able to resolve this? I'm running into a similar issue with some of the same packages in a SvelteKit app for a crypto application. Wanting to use Vercel, but running into build failures. My project actually begins the build process and gets far along until it hits @sveltejs/adapter-vercel
then it fails. I'm going to open a separate Issue.
@solanacryptodev i was not. Are you also using pnpm?
Please provide a minimal reproduction in the form of a code repository.
@eltigerchino For the second set of logs, https://github.com/jhechtf/vercel-adapter-breaking only breaks when using Pnpm. However, this is not the original set of errors I posted in regards to seeing the issue.
I can't reproduce the issue given the reproduction. Please provide another minimal reproduction.
~/github/vercel-adapter-breaking main 7s
❯ npm run build
> vercel-adapter-breaking@0.0.1 build
> vite build
vite v5.0.10 building SSR bundle for production...
✓ 76 modules transformed.
"DB_URL" is not exported by "virtual:$env/static/private", imported by "src/lib/server/client.ts".
file: /home/chewteeming/github/vercel-adapter-breaking/src/lib/server/client.ts:1:9
1: import { DB_URL } from '$env/static/private';
^
2: import { drizzle } from 'drizzle-orm/node-postgres';
3: import * as schema from "./schema";
error during build:
RollupError: "DB_URL" is not exported by "virtual:$env/static/private", imported by "src/lib/server/client.ts".
at error (file:///home/chewteeming/github/vercel-adapter-breaking/node_modules/rollup/dist/es/shared/parseAst.js:337:30)
at Module.error (file:///home/chewteeming/github/vercel-adapter-breaking/node_modules/rollup/dist/es/shared/node-entry.js:12755:16)
at Module.traceVariable (file:///home/chewteeming/github/vercel-adapter-breaking/node_modules/rollup/dist/es/shared/node-entry.js:13192:29)
at ModuleScope.findVariable (file:///home/chewteeming/github/vercel-adapter-breaking/node_modules/rollup/dist/es/shared/node-entry.js:11609:39)
at Identifier.bind (file:///home/chewteeming/github/vercel-adapter-breaking/node_modules/rollup/dist/es/shared/node-entry.js:7193:40)
at Property.bind (file:///home/chewteeming/github/vercel-adapter-breaking/node_modules/rollup/dist/es/shared/node-entry.js:4639:23)
at ObjectExpression.bind (file:///home/chewteeming/github/vercel-adapter-breaking/node_modules/rollup/dist/es/shared/node-entry.js:4635:28)
at NewExpression.bind (file:///home/chewteeming/github/vercel-adapter-breaking/node_modules/rollup/dist/es/shared/node-entry.js:4635:28)
at VariableDeclarator.bind (file:///home/chewteeming/github/vercel-adapter-breaking/node_modules/rollup/dist/es/shared/node-entry.js:4639:23)
at VariableDeclaration.bind (file:///home/chewteeming/github/vercel-adapter-breaking/node_modules/rollup/dist/es/shared/node-entry.js:4635:28)
After supplying a random value to .env
DB_URL
:
~/github/vercel-adapter-breaking main
❯ npm run build
> vercel-adapter-breaking@0.0.1 build
> vite build
vite v5.0.10 building SSR bundle for production...
✓ 76 modules transformed.
node:internal/event_target:1016
process.nextTick(() => { throw err; });
^
Error: getaddrinfo EAI_AGAIN base
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:108:26)
Emitted 'error' event on Worker instance at:
at [kOnErrorMessage] (node:internal/worker:300:10)
at [kOnMessage] (node:internal/worker:311:37)
at MessagePort.<anonymous> (node:internal/worker:212:57)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:741:20)
at exports.emitMessage (node:internal/per_context/messageport:23:28) {
errno: -3001,
code: 'EAI_AGAIN',
syscall: 'getaddrinfo',
hostname: 'base'
}
Node.js v18.17.1
Describe the bug
I have a project using svelte kit with Drizzle ORM and Supabase. The whole project is open source and can be found here. I recently updated everything to sveltekit 2, and since then my builds have been broken.
Reproduction
https://github.com/jhechtf/vercel-adapter-breaking - only using PNPM
https://github.com/sungmanito/mono/commit/5cc6e7326c28ab95ae363e4aad59415077adafce is where
pnpm build
stops working, giving these errorsLogs
System Info