vikejs / vike

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

Production runtime error after upgrading from 0.4.73 to 0.4.80 #647

Closed milanio closed 1 year ago

milanio commented 1 year ago

Description

Before upgrading to version 0.4.80 trying to bundle css to 1 file wouldn't work ( cssCodeSplit: false ). Hence I just tried to upgrade to version 0.4.80 from 0.4.73. After rebuild I am suddenly getting an error message while running in production mode

Error Message + Error Stack

Error: [vite-plugin-ssr@0.4.80][Bug] You stumbled upon a bug in vite-plugin-ssr's source code. Reach out at https://github.com/brillout/vite-plugin-ssr/issues/new or https://discord.com/invite/qTq92FQzKb and include this error stack (the error stack is usually enough to fix the problem). A maintainer will fix the bug (usually under 24 hours). Don't hesitate to reach out as it makes vite-plugin-ssr more robust.
    at removeFileExtentionAndHash (C:\src\GBC4\GBC4.Vue3\node_modules\vite-plugin-ssr\dist\cjs\node\runtime\renderPage\createHttpResponseObject.js:150:24)
    at isFontFallback (C:\src\GBC4\GBC4.Vue3\node_modules\vite-plugin-ssr\dist\cjs\node\runtime\renderPage\createHttpResponseObject.js:137:25)     
    at C:\src\GBC4\GBC4.Vue3\node_modules\vite-plugin-ssr\dist\cjs\node\runtime\renderPage\createHttpResponseObject.js:36:17
    at Array.forEach (<anonymous>)
    at createHttpResponseObject (C:\src\GBC4\GBC4.Vue3\node_modules\vite-plugin-ssr\dist\cjs\node\runtime\renderPage\createHttpResponseObject.js:34:16)
    at async renderPageContext (C:\src\GBC4\GBC4.Vue3\node_modules\vite-plugin-ssr\dist\cjs\node\runtime\renderPage\renderPageContext.js:70:30)    
    at async renderPageAttempt (C:\src\GBC4\GBC4.Vue3\node_modules\vite-plugin-ssr\dist\cjs\node\runtime\renderPage.js:155:36)
    at async renderPage (C:\src\GBC4\GBC4.Vue3\node_modules\vite-plugin-ssr\dist\cjs\node\runtime\renderPage.js:39:35)
brillout commented 1 year ago

Insert the following before the line C:\src\GBC4\GBC4.Vue3\node_modules\vite-plugin-ssr\dist\cjs\node\runtime\renderPage\createHttpResponseObject.js:150:24:

    if( filenameParts.length === 0 ) { console.log('assetUrl', assetUrl) };

What's the log output?

milanio commented 1 year ago

Thanks @brillout for such a quick response! Log is: assetUrl /assets/gbc-iconset-2017-11-13-r2-328220f2.woff

brillout commented 1 year ago

To what value did you set config.build.rollupOptions.output.assetFileNames?

milanio commented 1 year ago

chunkFileNames:"[name]-r2-[hash].js", assetFileNames:"assets/[name]-r2-[hash][extname]"

However, when I remove this setting the problem seems to be resolved. Is the problem with extra "-" in the filename?

brillout commented 1 year ago

Fix released in 0.4.81. I didn't test it but it should work. Let me know if it doesn't.

Also, in case your company is up for it: https://github.com/sponsors/brillout. This is making a big diiference!

milanio commented 1 year ago

Thank you @brillout , I will test it and report back.

milanio commented 1 year ago

Seems to be working like a charm. Thanks @brillout!