blitz icon indicating copy to clipboard operation
blitz copied to clipboard

Optional chaining from @blitzjs/auth crashes app on old devices

Open BadCoder1337 opened this issue 2 years ago • 1 comments

What is the problem?

After upgrade to Blitz 2.0 I found regression on iOS 12. Regardless of configuration (previously working babel.config.js, next-transpile-modules, etc.) I can't fix it.

Paste all your error logs here:

SyntaxError: Unexpected token '.'

Paste all relevant code snippets here:

https://github.com/blitz-js/blitz/blob/e3523407b9abadfc21f01bc57f8421cd351dc510/packages/blitz-auth/src/client/index.tsx#L72-L84

What are detailed steps to reproduce this?

  1. Init new app with auth
  2. Run it
  3. Open with Safari 12 (I'm using Browserstack)

Run blitz -v and paste the output here:

Blitz version: 2.0.0-beta.3 (global)
Blitz version: 2.0.0-beta.3 (local)
Windows 11 | win32-x64 | Node: v16.15.1


 Package manager: npm

  System:
    OS: Windows 10 10.0.22622
    CPU: (12) x64 AMD Ryzen 5 2600 Six-Core Processor
    Memory: 5.03 GB / 15.93 GB
  Binaries:
    Node: 16.15.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.18 - C:\Program Files\nodejs\yarn.CMD
    npm: 8.11.0 - C:\Program Files\nodejs\npm.CMD
  npmPackages:
    @blitzjs/auth: 2.0.0-beta.3 => 2.0.0-beta.3
    @blitzjs/next: 2.0.0-beta.3 => 2.0.0-beta.3
    @blitzjs/rpc: 2.0.0-beta.3 => 2.0.0-beta.3
    @prisma/client: 4.0.0 => 4.0.0
    blitz: 2.0.0-beta.3 => 2.0.0-beta.3
    next: 12.2.5 => 12.2.5
    prisma: 4.0.0 => 4.0.0
    react: 18.2.0 => 18.2.0
    react-dom: 18.2.0 => 18.2.0
    typescript: ^4.5.3 => 4.8.2

Please include below any other applicable logs and screenshots that show your problem:

image

BadCoder1337 avatar Aug 31 '22 20:08 BadCoder1337

Thanks for sharing. We'll take a look at this

dillondotzip avatar Sep 01 '22 13:09 dillondotzip

I will try to fix this one. Looks kinda tricky but 🤞 .

estevanjantsk avatar Oct 06 '22 10:10 estevanjantsk