Comments (9)
Found the issue:
#165
The new version of the package causing the issue (apg-js) was released 5 hours ago.
Before a new version of the siwe package is released with its package.json containing the right dependency you can manually tell npm which version you want to be installed using the override
property. In my case adding this to the package.json
fixed the issue:
"overrides": {
"siwe": {
"apg-js": "^4.2.0"
}
}
Edit: Made the response more generic for everyone
from siwe.
Thanks for much for this.
I ended up having to use:
"overrides": {
"@spruceid/siwe-parser": {
"apg-js": "4.2.0"
}
}
for siwe 1.4.2
from siwe.
Ah ma bad. For the sake of this GitHub Issue, I genericized the code but didn't do a good job of that 🤦♂️. I will update the snippet to be a valid nonce.
from siwe.
Has this every been solved @jpangelle ? I have the same issue, I'm not sure how to resolve it. I just need the prepareMessage function as well.
from siwe.
@felixdenoix I ended up just doing the SIWE manually - you can check any of the code at https://github.com/Wallet-Chat/walletchatFE/blob/4d7a7b461c32100d49f643f932fcd46345ca6139/src/context/WalletProvider.tsx#L628
from siwe.
shouldn't your nonce be only nonce
instead of nonce.nonce
? Also it's invalid, there should be no spaces in your nonce. https://eips.ethereum.org/EIPS/eip-4361#message-field-descriptions
nonce
is a randomized token typically chosen by the relying party and used to prevent replay attacks, at least 8 alphanumeric characters.
from siwe.
By the error message I would dare say it's related to the ABNF parser, do you have Node's Buffer as a polyfill? Also I'm not really sure about your use case / project, but you might also be interested at SSX.
from siwe.
By the error message I would dare say it's related to the ABNF parser, do you have Node's Buffer as a polyfill? Also I'm not really sure about your use case / project, but you might also be interested at SSX.
It appears that we are already polyfilling: https://github.com/centrifuge/apps/blob/main/centrifuge-app/vite.config.ts#L44
from siwe.
Hi,
Sorry to necrobump as well but I have the same issue. I'm on a nuxt@3 project and I thought i had all the necessary polyfills. @jpangelle, could you share your solution around here ?
Nuxt config file for reference if it can be of any use:
import { polyfillNode } from "esbuild-plugin-polyfill-node";
import inject from '@rollup/plugin-inject';
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
ssr: false,
vite: {
optimizeDeps: {
include: ['siwe/*'],
esbuildOptions: {
define: {
global: 'globalThis',
},
plugins: [
polyfillNode({
globals: {
buffer: true
},
}),
],
},
},
build: {
target: 'esnext',
commonjsOptions: {
transformMixedEsModules: true,
},
rollupOptions: {
plugins: [inject({ Buffer: ['buffer', 'Buffer'] })],
}
},
resolve: {
alias: {
// polyfills
'readable-stream': 'vite-compatible-readable-stream',
stream: 'vite-compatible-readable-stream',
},
},
},
});
from siwe.
Related Issues (20)
- Is there a cdn release? Want to try siwe with Flutter Web HOT 2
- Can't resolve `net` error with SiweMessage HOT 2
- Using siwe message giving me error "Buffer is not defined" HOT 2
- ncaught Error: No QueryClient set, use QueryClientProvider to set one
- TypeError: (0 , siwe_parser_1.isEIP55Address) is not a function HOT 1
- Cannot read property 'SiweMessage' of undefined HOT 2
- Invalid signature recovery are logged via console.error, breaking applications with custom logging flow
- Viem support? HOT 13
- isEIP55Address cannot be called because @spruceid/siwe-parser might be below 2.0.0 version HOT 3
- Suggestion regarding siwe-parser usage of apg-js. HOT 9
- Please provide CDN HOT 1
- Change Provider configuration to allow plain RPC URL property
- Cannot sign in with Argent wallet HOT 1
- Custom logo when authenticating, possible? HOT 4
- Crash on iOS 14 When Initializing SiweMessage Instance HOT 5
- I'm not getting the right address when checking HOT 3
- '"ethers"' has no exported member named 'providers' HOT 1
- Why version "2.1.4", requires SiweMessage.version to be 1? HOT 1
- Module parse failed: 'import' and 'export' may appear only with 'sourceType: module' (2:0) HOT 1
- Cloudflare Workers compatibility HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from siwe.