QwikDev / qwik

Instant-loading web apps, without effort
https://qwik.dev
MIT License
20.85k stars 1.31k forks source link

[🐞] Auth.js integration breaks routing system. useNavigate and Link components will not go to pages that import plugin@auth #7083

Closed ShererJohn closed 1 day ago

ShererJohn commented 1 day ago

Which component is affected?

Qwik City (routing)

Describe the bug

Link components and the useNavigate function both break when going to a page that imports the auth.js integration

SyntaxError: The requested module '/node_modules/cookie/index.js?v=da1814f6' does not provide an export named 'parse' (at jwt.js?v=da1814f6:42:10)

Reproduction

https://github.com/ShererJohn/qwiklab

Steps to reproduce

git clone https://github.com/ShererJohn/qwiklab.git
cd ./qwiklab
npm i
npm run dev

Then click the link named "Problem link"

System Info

System:
    OS: Linux 6.10 Fedora Linux 40 (Workstation Edition)
    CPU: (4) x64 Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz
    Memory: 7.56 GB / 15.48 GB
    Container: Yes
    Shell: 5.2.26 - /bin/bash
  Binaries:
    Node: 22.5.1 - ~/.nvm/versions/node/v22.5.1/bin/node
    Yarn: 1.22.22 - /usr/bin/yarn
    npm: 10.9.0 - ~/.nvm/versions/node/v22.5.1/bin/npm
    bun: 1.1.22 - ~/.bun/bin/bun
  npmPackages:
    @builder.io/qwik: ^1.10.0 => 1.10.0 
    @builder.io/qwik-city: ^1.10.0 => 1.10.0 
    typescript: 5.4.5 => 5.4.5 
    undici: * => 6.21.0 
    vite: 5.3.5 => 5.3.5

Additional Information

If this integration is not the responsibility of qwik, then it should be removed from the default list of integrations. This bug makes the entire framework unusable.

gioboa commented 1 day ago

Hi, thanks for your feedback. I can feel your pain but let's try to figure out a possible solution for this issue. Is it working with <a> HTML tag?

ShererJohn commented 1 day ago

It is

gioboa commented 1 day ago

It is

I searched that error and I found a thread in the nuxt repo. Here is a possible solution

ShererJohn commented 1 day ago

It worked, thank you!

Could you make a PR that adds this as a part of the integration?

gioboa commented 1 day ago

Yes I will update it, I'm glad you solved the issue