-
Notifications
You must be signed in to change notification settings - Fork 527
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
Sveltekit example does not work with vercel #2078
Comments
@Elliott-Green I was able to get it up and running with the following steps:
Then, include it in your Vite configuration:
Can you give that a try and let me know? |
PR to get the example working : #2086 |
Hey @Adamj1232, Thanks for looking into this. I've picked the changes up from #2086 but alas, I'm still having the same issues. Did you ever get a vercel deployment out for 2086? build+preview work locally, so looks ok, but will error on vercel. Had a few other local issues that I managed to resolve, would recommend these packages get updated as they've been patched to work nicely with commonJS - or something, I have no idea, this side of js is a black box to me. 4:05:42 PM [vite] Error when evaluating SSR module /node_modules/@web3-onboard/core/node_modules/svelte-i18n/dist/runtime.esm.js: failed to import "intl-messageformat"
|- SyntaxError: [vite] Named export 'IntlMessageFormat' not found. The requested module 'intl-messageformat' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'intl-messageformat';
const {IntlMessageFormat} = pkg; By overriding some of the package versions, I am able to resolve some of my build issues like: "overrides": {
"@web3-onboard/core": {
"svelte-i18n": "^4.0.0",
"intl-messageformat": "^10.5.1",
"bnc-sdk": {
"rxjs": "^7.8.1"
}
},
"@web3-onboard/coinbase": {
"@coinbase/wallet-sdk": {
"rxjs": "^7.8.1"
}
},
// Not sure about this one, trying to fix atm
"@web3-onboard/trezor": {
"@ethereumjs/tx": "^5.2.1",
"eth-crypto": {
"@ethereumjs/tx": "^5.2.1"
}
}
} Svelte-i18n/intl-messageformathttps://stackoverflow.com/questions/77193468/syntaxerror-when-building-sveltekit-the-requested-module-intl-messageformat-i ethereumjs/txerror during build:
RollupError: [vite-plugin-sveltekit-compile] node_modules/eth-crypto/dist/es/sign-transaction.js (1:9): "Transaction" is not exported by "node_modules/eth-crypto/node_modules/@ethereumjs/tx/dist.browser/index.js", imported by "node_modules/eth-crypto/dist/es/sign-transaction.js".
file: /Users/elliott/Documents/GitHub/5725Cafe/node_modules/eth-crypto/dist/es/sign-transaction.js:1:9
1: import { Transaction } from '@ethereumjs/tx';
^
2: import { publicKeyByPrivateKey } from './public-key-by-private-key';
3: import { toAddress as addressByPublicKey } from './public-key';
file: /Users/elliott/Documents/GitHub/5725Cafe/node_modules/eth-crypto/dist/es/sign-transaction.js:1:9
1: import { Transaction } from '@ethereumjs/tx';
^
2: import { publicKeyByPrivateKey } from './public-key-by-private-key';
3: import { toAddress as addressByPublicKey } from './public-key'; |
I still have the issue to this date. Also, the svelte/sveltekit examples could really use an upgrade to svelte 5 which has been out for 2 months.
This did not work for me on At the moment I'm unable to use |
@beeb there is a release coming out today which will use the latest |
This fix is live with the latest version released today! Please let me know if you have any other issues. Thanks again! |
The build now works thanks! The wagmi integration still doesn't however. I'll open an issue if I find the time over the next days. |
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
Anything else?
No response
Sanity Check
The text was updated successfully, but these errors were encountered: