Coder Social home page Coder Social logo

Comments (9)

felixdenoix avatar felixdenoix commented on June 22, 2024 2

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.

klugjo avatar klugjo commented on June 22, 2024 2

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.

jpangelle avatar jpangelle commented on June 22, 2024 1

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.

cryptoKevinL avatar cryptoKevinL commented on June 22, 2024 1

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.

cryptoKevinL avatar cryptoKevinL commented on June 22, 2024 1

@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.

w4ll3 avatar w4ll3 commented on June 22, 2024

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.

w4ll3 avatar w4ll3 commented on June 22, 2024

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.

jpangelle avatar jpangelle commented on June 22, 2024

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.

felixdenoix avatar felixdenoix commented on June 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.