QwikDev / qwik

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

[🐞] Provide more data for [vite-plugin-qwik-post] Cannot read properties of undefined (reading 'fileName') #6895

Open Nefcanto opened 6 days ago

Nefcanto commented 6 days ago

Which component is affected?

Qwik Runtime

Describe the bug

npm run build fails in my CI/CD with this message:

#8 23.42 x Build failed in 19.75s
#8 23.42 error during build:
#8 23.42 [vite-plugin-qwik-post] Cannot read properties of undefined (reading 'fileName')
#8 23.42     at file:///npm/node_modules/@builder.io/qwik/dist/optimizer.mjs:1649:145
#8 23.42     at Array.map (<anonymous>)
#8 23.42     at generateManifestFromBundles (file:///npm/node_modules/@builder.io/qwik/dist/optimizer.mjs:1649:108)
#8 23.42     at Object.generateManifest (file:///npm/node_modules/@builder.io/qwik/dist/optimizer.mjs:2374:24)
#8 23.42     at Object.handler (file:///npm/node_modules/@builder.io/qwik/dist/optimizer.mjs:6252:49)
#8 23.42     at file:///npm/node_modules/rollup/dist/es/shared/node-entry.js:19936:40
#8 23.42     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

npm run build works in my local environment.

I know it might be a problem related to our CI/CD. But, you should give us more details about this error. Right now, there is no data in this error related to my code.

Reproduction

I can't produce an MRE

Steps to reproduce

No response

System Info

System:
    OS: Linux 6.8 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (4) x64 Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz
    Memory: 8.95 GB / 15.53 GB
    Container: Yes
    Shell: 5.2.15 - /bin/bash
  Binaries:
    Node: 20.17.0 - /usr/local/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.8.3 - /usr/local/bin/npm
  Browsers:
    Chromium: 129.0.6668.58
  npmPackages:
    @builder.io/partytown: ^0.10.2 => 0.10.2 
    @builder.io/qwik: ^1.9.0 => 1.9.0 
    @builder.io/qwik-auth: ^0.2.2 => 0.2.2 
    @builder.io/qwik-city: ^1.9.0 => 1.9.0 
    typescript: ^5.6.2 => 5.6.2 
    undici: ^6.19.8 => 6.19.8 
    vite: ^5.4.4 => 5.4.6

Additional Information

No response

Nefcanto commented 6 days ago

I think this line causes the problem.

wmertens commented 6 days ago

This is fixed in #6888. Can you verify with the packages here: https://github.com/QwikDev/qwik/actions/runs/10960904575/job/30437326583#step:13:26

Nefcanto commented 6 days ago

@wmertens, thank you so much for this fast response. Two notes:

  1. I don't know how to use those builds. Can you please provide a hint?
  2. It's good to add more data if possible to errors.
Nefcanto commented 5 days ago

@wmertens, I'm still stuck. Can you help with how should I use those packages?

wmertens commented 4 days ago

@Nefcanto you have to replace the versions in package.json with the urls given there and then run your package manager (e.g. pnpm i)

@builder.io/qwik: npm i https://pkg.pr.new/@builder.io/qwik@ae09275 @builder.io/qwik-city: npm i https://pkg.pr.new/@builder.io/qwik-city@ae09275 eslint-plugin-qwik: npm i https://pkg.pr.new/eslint-plugin-qwik@ae09275 create-qwik: npm i https://pkg.pr.new/create-qwik@ae09275

gimonaa commented 3 days ago

Thanks, this solved my problem too. vite v5.4.8 building for production... ✓ 1101 modules transformed. x Build failed in 3.49s error during build: [vite-plugin-qwik-post] Cannot read properties of undefined (reading 'fileName') at file:///Users/alessandrogimona/Git/qwik/preweb3-qwik/node_modules/@builder.io/qwik/dist/optimizer.mjs:1649:145 at Array.map (<anonymous>) at generateManifestFromBundles (file:///Users/alessandrogimona/Git/qwik/preweb3-qwik/node_modules/@builder.io/qwik/dist/optimizer.mjs:1649:108) at Object.generateManifest (file:///Users/alessandrogimona/Git/qwik/preweb3-qwik/node_modules/@builder.io/qwik/dist/optimizer.mjs:2374:24) at Object.handler (file:///Users/alessandrogimona/Git/qwik/preweb3-qwik/node_modules/@builder.io/qwik/dist/optimizer.mjs:6252:49) at file:///Users/alessandrogimona/Git/qwik/preweb3-qwik/node_modules/rollup/dist/es/shared/node-entry.js:19936:40 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)