vikejs / vike

🔨 Flexible, lean, community-driven, dependable, fast Vite-based frontend framework.
https://vike.dev
MIT License
4.39k stars 352 forks source link

Pre-render failing #1929

Closed metycletools closed 1 month ago

metycletools commented 1 month ago

Description

Error: [vike@0.4.193][Bug] You stumbled upon a Vike bug. Go to https://github.com/vikejs/vike/issues/new and copy-paste this error. A maintainer will fix the bug (usually under 24 hours). at write (file:///Users/work/projects/frontend/node_modules/vike/dist/esm/node/prerender/runPrerender.js:580:5) at writeFiles (file:///Users/work/projects/frontend/node_modules/vike/dist/esm/node/prerender/runPrerender.js:562:9) at onComplete (file:///Users/work/projects/frontend/node_modules/vike/dist/esm/node/prerender/runPrerender.js:103:15) at file:///Users/work/projects/frontend/node_modules/vike/dist/esm/node/prerender/runPrerender.js:496:15 Warning: command "vite build --outDir=../../dist/apps/static-website --mode=production" exited with non-zero status code

brillout commented 1 month ago

Try again with the latest version and let's re-open if you still get this (copy-paste the new stack trace then).

metycletools commented 1 month ago

failing with latest version too

To add more context its not a new project, the version 0.4.193 was passing until yesterday successfully

Error: [vike@0.4.199][Bug] You stumbled upon a Vike bug. Go to https://github.com/vikejs/vike/issues/new and copy-paste this error. A maintainer will fix the bug (usually under 24 hours). at write (file:///Users/work/projects/frontend/node_modules/vike/dist/esm/node/prerender/runPrerender.js:580:5) at writeFiles (file:///Users/work/projects/frontend/node_modules/vike/dist/esm/node/prerender/runPrerender.js:562:9) at onComplete (file:///Users/work/projects/frontend/node_modules/vike/dist/esm/node/prerender/runPrerender.js:103:15) at file:///Users/work/projects/frontend/node_modules/vike/dist/esm/node/prerender/runPrerender.js:496:15 Warning: command "vite build --outDir=../../dist/apps/static-website --mode=production" exited with non-zero status code

brillout commented 1 month ago

Insert the following before line 580 of /Users/work/projects/frontend/node_modules/vike/dist/esm/node/prerender/runPrerender.js and report back the result.

    const filePathRelative = fileUrl.slice(1);
+   console.log('urlOriginal', urlOriginal);
+   console.log('fileUrl', fileUrl);
    assert(!filePathRelative.startsWith('/'));
metycletools commented 1 month ago

Found the issue with above suggestion, it was not vike related

Generated files were with // which was wrong, fixed page URL and it started to work