QwikDev / qwik

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

[🐞] SyntaxError: Named export 'FormData' not found. The requested module 'undici' is a CommonJS module, which may not support all module.exports as named exports. #5721

Closed ryanwanjohi closed 1 day ago

ryanwanjohi commented 5 months ago

Which component is affected?

Qwik City (routing)

Describe the bug

I get this error while trying to run qwik v1.3.5 it was okay on v.1.3.2, I even tried installing undici@5.28.2 (as suggested on #5699 ) and it still gives me this error.

I am on a linux machine using Node 20.11(stable)

2024-01-16 10_02_30-package json - kenyamoja  SSH_ coder-vscode--wanjohi--ryan  - Visual Studio Code

Reproduction

How exactly?

Steps to reproduce

Try installing a new qwik project suing pnpm then run pnpm dev

System Info

System:
    OS: Linux 6.2 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
    CPU: (4) x64 Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
    Memory: 9.23 GB / 15.43 GB
    Container: Yes
    Shell: 5.1.4 - /bin/bash
  Binaries:
    Node: 20.11.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.4 - /usr/local/bin/npm
    pnpm: 8.14.1 - ~/.local/share/pnpm/pnpm
  npmPackages:
    @builder.io/qwik: ^1.3.5 => 1.3.5 
    @builder.io/qwik-city: ^1.3.5 => 1.3.5 
    @builder.io/qwik-react: 0.5.0 => 0.5.0 
    vite: ^5.0.11 => 5.0.11

Additional Information

No response

wmertens commented 5 months ago

Can you try with the @dev version? Replace qwik, qwik-city and eslint-plugin-qwik's version with "dev" in your package.json and run (p)npm/yarn

ryanwanjohi commented 5 months ago

Hey @wmertens it works, when I add dev version.

So do you recommend I use this in production?

wmertens commented 5 months ago

@ryanwanjohi the fix is now in 1.4.0, upgrade recommended :-)

thejackshelton commented 1 month ago

Reopening as me and another user are getting this issue.

osdiab commented 1 day ago

I am also getting this on 1.7.0.

osdiab commented 1 day ago

Found out why, for some reason the default * version caused pnpm to choose version 0.1.0 of undici instead of the latest one, idk why.

@builder.io/qwik 1.6.0
└── undici 0.1.0 peer
@builder.io/qwik-city 1.6.0
└── undici 0.1.0
@qwik-ui/headless 0.4.4
└─┬ @builder.io/qwik 1.6.0 peer
  └── undici 0.1.0 peer
@qwikest/icons 0.0.13
└─┬ @builder.io/qwik 1.6.0 peer
  └── undici 0.1.0 peer
undici 0.1.0

I changed it to instead use undici: "^6" and alls good.

gioboa commented 1 day ago

Thanks 😉 I'm glad that it's working.