litentry / PolkaSignIn

Apache License 2.0
3 stars 1 forks source link

Can not run demo: Unhandled Runtime Error SyntaxError: Unexpected token '.' #8

Closed sg552 closed 2 years ago

sg552 commented 2 years ago

my environment:

ubuntu 18 nodejs 16.14.0

how to re-cur:

  1. yarn
  2. cd demo/nextjs-demo
  3. yarn dev

image

sg552 commented 2 years ago

OK, I managed it solved.

open packages/polkasignin-client/lib/inject-accounts.js, change this code:

const signRaw = injector?.signer?.signRaw;

to

    const result1 = injector
    const result2 = result1.signer
    const result3 = result2.signRaw
    const signRaw = result3

This is ugly but solved my problem. Maybe author should specify a node version.

bdmason commented 2 years ago

Cheers @sg552, the ?. syntax is a bit dangerous, I'll get rid. What browser were you using? (assuming this failed in the browser)