Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Stumbled upon a Vike bug" when using Vanilla Extract ^4.0.4 #1592

Closed
Alduino opened this issue Apr 2, 2024 · 4 comments
Closed

"Stumbled upon a Vike bug" when using Vanilla Extract ^4.0.4 #1592

Alduino opened this issue Apr 2, 2024 · 4 comments
Labels

Comments

@Alduino
Copy link

Alduino commented Apr 2, 2024

Description

Hi, when I build a Vike application that also has @vanilla-extract/vite-plugin@^4.0.4, I get the following error (including the rest of the logs):

vite v5.2.7 building for production...
transforming (1) virtual:vike:pageConfigValuesAll:client:(!) Experimental optimizeDeps.disabled and deps pre-bundling during build were removed in Vite 5.1.
    To disable the deps optimizer, set optimizeDeps.noDiscovery to true and optimizeDeps.include as undefined or empty.
    Please remove optimizeDeps.disabled from your config.
Error: [[email protected]][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 isDev1_onConfigureServer (file:///Users/zach.barham/Downloads/reprod-vike-bug/node_modules/.pnpm/[email protected][email protected]/node_modules/vike/dist/esm/utils/isDev.js:20:5)
    at configureServer (file:///Users/zach.barham/Downloads/reprod-vike-bug/node_modules/.pnpm/[email protected][email protected]/node_modules/vike/dist/esm/node/plugin/plugins/importUserCode/index.js:60:13)
    at _createServer (file:///Users/zach.barham/Downloads/reprod-vike-bug/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-C-KAszbv.js:64822:30)
    at createViteServer (/Users/zach.barham/Downloads/reprod-vike-bug/node_modules/.pnpm/@[email protected]/node_modules/@vanilla-extract/integration/dist/vanilla-extract-integration.cjs.prod.js:583:18)

Looks like they changed some internal build stuff in that release - https://github.com/vanilla-extract-css/vanilla-extract/releases/tag/%40vanilla-extract%2Fvite-plugin%404.0.4

Edit: actually, v4.0.4 gives a different error message than ^4.0.5 (but that's an old version so it doesn't matter):

vite v5.2.7 building for production...
(!) Experimental optimizeDeps.disabled and deps pre-bundling during build were removed in Vite 5.1.
    To disable the deps optimizer, set optimizeDeps.noDiscovery to true and optimizeDeps.include as undefined or empty.
    Please remove optimizeDeps.disabled from your config.
✓ 9 modules transformed.
x Build failed in 55ms
error during build:
Error: [[email protected]][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 getCode (file:///home/alduino/Documents/Projects/reprod-vike-bug/node_modules/.pnpm/[email protected][email protected]/node_modules/vike/dist/esm/node/plugin/plugins/importUserCode/getVirtualFileImportUserCode.js:22:5)
    at getVirtualFileImportUserCode (file:///home/alduino/Documents/Projects/reprod-vike-bug/node_modules/.pnpm/[email protected][email protected]/node_modules/vike/dist/esm/node/plugin/plugins/importUserCode/getVirtualFileImportUserCode.js:15:24)
    at Object.load (file:///home/alduino/Documents/Projects/reprod-vike-bug/node_modules/.pnpm/[email protected][email protected]/node_modules/vike/dist/esm/node/plugin/plugins/importUserCode/index.js:55:36)
    at file:///home/alduino/Documents/Projects/reprod-vike-bug/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:19595:40
    at PluginDriver.hookFirstAndGetPlugin (file:///home/alduino/Documents/Projects/reprod-vike-bug/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:19495:28)
    at file:///home/alduino/Documents/Projects/reprod-vike-bug/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:18666:33
    at Queue.work (file:///home/alduino/Documents/Projects/reprod-vike-bug/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:19705:32)

Minimal reprod: https://github.com/Alduino/reprod-vike-bug

@brillout
Copy link
Member

brillout commented Apr 2, 2024

Hm, it seems to be an issue with Vanilla Extract, but let me have a look.

@brillout
Copy link
Member

brillout commented Apr 2, 2024

Minimal reprod: https://github.com/Alduino/reprod-vike-bug

I get a 404, did you publish the reproduction?

@Alduino
Copy link
Author

Alduino commented Apr 2, 2024

Oops, forgot to make it public. Should be fixed now!

@brillout
Copy link
Member

brillout commented Apr 2, 2024

Fix pre-released as 0.4.168-commit-7678a7d.

VE's Vite plugin is quite unconventional; let me know if you still run into issues with it.

In case your company is up for it, we're looking for sponsors (#1350) — it mkaes a massive difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants