Skip to content

Sveltekit example does not work with vercel #2078

@Elliott-Green

Description

@Elliott-Green

Current Behavior

Deploying the sveltekit example repo here https://github.com/blocknative/web3-onboard/tree/main/examples/with-sveltekit
to vercel causes an error

Expected Behavior

Deploying to vercel should return no error.

Steps To Reproduce

https://github.com/Elliott-Green/sk-web3-vercel-minrepo OR https://github.com/blocknative/web3-onboard/tree/main/examples/with-sveltekit

git clone https://github.com/Elliott-Green/sk-web3-vercel-minrepo.git
npm i
npm run build
npm run preview
git commit -m "[chore] poke build"
vercel builds, errors with log

What package is effected by this issue?

@web3-onboard/core

Is this a build or a runtime issue?

Build

Package Version

2.21.0

Node Version

20.10.0

What browsers are you seeing the problem on?

Firefox

Relevant log output

Cloning github.com/Elliott-Green/sk-web3-vercel-minrepo (Branch: main, Commit: d984944) Cloning completed: 292.694ms Previous build cache not available Running "vercel build" Vercel CLI 33.5.3 Installing dependencies... yarn install v1.22.17 warning package.json: No license field warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json. warning with-sveltekit@0.0.1: No license field [1/4] Resolving packages... [2/4] Fetching packages... [3/4] Linking dependencies... warning "@web3-onboard/walletconnect > @walletconnect/modal > @web3modal/core > valtio > use-sync-external-store@1.2.0" has unmet peer dependency "react@^16.8.0 || ^17.0.0 || ^18.0.0". warning " > rollup-plugin-polyfill-node@0.12.0" has unmet peer dependency "rollup@^1.20.0 || ^2.0.0 || ^3.0.0". [4/4] Building fresh packages... success Saved lockfile. Done in 21.44s. Running "yarn run build" yarn run v1.22.17 warning package.json: No license field $ vite build vite v4.0.5 building for production... transforming... ✓ 677 modules transformed. 6:45:33 PM [vite-plugin-svelte] dom compile done. package files time avg with-sveltekit 4 0.17s 43.4ms [vite]: Rollup failed to resolve import "Buffer" from "/vercel/path0/node_modules/@walletconnect/encoding/dist/esm/index.js". This is most likely unintended because it can break your application at runtime. If you do want to externalize this module explicitly add it to `build.rollupOptions.external` error during build: Error: [vite]: Rollup failed to resolve import "Buffer" from "/vercel/path0/node_modules/@walletconnect/encoding/dist/esm/index.js". This is most likely unintended because it can break your application at runtime. If you do want to externalize this module explicitly add it to `build.rollupOptions.external` at onRollupWarning (file:///vercel/path0/node_modules/vite/dist/node/chunks/dep-9cd3c8cb.js:44636:19) at onwarn (file:///vercel/path0/node_modules/vite/dist/node/chunks/dep-9cd3c8cb.js:44407:13) at file:///vercel/path0/node_modules/rollup/dist/es/shared/node-entry.js:24276:13 at Object.logger [as onLog] (file:///vercel/path0/node_modules/rollup/dist/es/shared/node-entry.js:25950:9) at ModuleLoader.handleInvalidResolvedId (file:///vercel/path0/node_modules/rollup/dist/es/shared/node-entry.js:24862:26) at file:///vercel/path0/node_modules/rollup/dist/es/shared/node-entry.js:24822:26 error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. Error: Command "yarn run build" exited with 1

Anything else?

No response

Sanity Check

  • If this is a build issue, I have included my build config. If this is a runtime issue, I have included reproduction steps and/or a Minimal, Reproducible Example.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions