You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remix would successfully build and display correct styles as per root.css.ts
Actual Behavior
Build fails with the following error:
[ERROR] Build failed with 1 error:
node_modules/@vanilla-extract/integration/dist/vanilla-extract-integration.cjs.dev.js:338:10: ERROR: [plugin: vanilla-extract-plugin] Couldn't find parent package.json with a name field from '/Users/kylelambert/Documents/vanilla-extract-css-test/app' [plugin css-bundle-update-plugin]
app/root.tsx:20:30:
20 │ import { cssBundleHref } from "@remix-run/css-bundle";
╵ ~~~~~~~~~~~~~~~~~~~~~~~
This error came from the "onLoad" callback registered here:
node_modules/@remix-run/dev/dist/compiler/plugins/cssBundlePlugin.js:47:12:
47 │ build.onLoad({
╵ ~~~~~~
at setup (/Users/kylelambert/Documents/vanilla-extract-css-test/node_modules/@remix-run/dev/dist/compiler/plugins/cssBundlePlugin.js:47:13)
at handlePlugins (/Users/kylelambert/Documents/vanilla-extract-css-test/node_modules/esbuild/lib/main.js:1279:21)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
✘ [ERROR] Couldn't find parent package.json with a name field from '/Users/kylelambert/Documents/vanilla-extract-css-test/app' [plugin vanilla-extract-plugin]
node_modules/@vanilla-extract/integration/dist/vanilla-extract-integration.cjs.dev.js:338:10:
338 │ throw new Error(`Couldn't find parent package.json with a nam...
╵ ^
at getPackageInfo (/Users/kylelambert/Documents/vanilla-extract-css-test/node_modules/@vanilla-extract/integration/dist/vanilla-extract-integration.cjs.dev.js:338:11)
at createViteServer (/Users/kylelambert/Documents/vanilla-extract-css-test/node_modules/@vanilla-extract/integration/dist/vanilla-extract-integration.cjs.dev.js:575:15)
at Object.createCompiler (/Users/kylelambert/Documents/vanilla-extract-css-test/node_modules/@vanilla-extract/integration/dist/vanilla-extract-integration.cjs.dev.js:656:23)
at getCompiler (/Users/kylelambert/Documents/vanilla-extract-css-test/node_modules/@remix-run/dev/dist/compiler/plugins/vanillaExtract.js:27:38)
at /Users/kylelambert/Documents/vanilla-extract-css-test/node_modules/@remix-run/dev/dist/compiler/plugins/vanillaExtract.js:141:24
at requestCallbacks.on-load (/Users/kylelambert/Documents/vanilla-extract-css-test/node_modules/esbuild/lib/main.js:1421:28)
at handleRequest (/Users/kylelambert/Documents/vanilla-extract-css-test/node_modules/esbuild/lib/main.js:723:19)
at handleIncomingPacket (/Users/kylelambert/Documents/vanilla-extract-css-test/node_modules/esbuild/lib/main.js:745:7)
at Socket.readFromStdout (/Users/kylelambert/Documents/vanilla-extract-css-test/node_modules/esbuild/lib/main.js:673:7)
at Socket.emit (node:events:511:28)
at addChunk (node:internal/streams/readable:332:12)
at readableAddChunk (node:internal/streams/readable:305:9)
at Readable.push (node:internal/streams/readable:242:10)
at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
This error came from the "onLoad" callback registered here:
node_modules/@remix-run/dev/dist/compiler/plugins/vanillaExtract.js:136:12:
136 │ build.onLoad({
╵ ~~~~~~
at setup (/Users/kylelambert/Documents/vanilla-extract-css-test/node_modules/@remix-run/dev/dist/compiler/plugins/vanillaExtract.js:136:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async handlePlugins (/Users/kylelambert/Documents/vanilla-extract-css-test/node_modules/esbuild/lib/main.js:1326:9)
The plugin "vanilla-extract-plugin" was triggered by this import
app/root.tsx:19:24:
19 │ import * as styles from "./root.css";
╵ ~~~~~~~~~~~~
The text was updated successfully, but these errors were encountered:
Upon further investigation, this isn't an issue with Remix, or Vanilla Extract. VE looks for name in package.json to prepend to the virtual modules it creates. Solution is to add a package name in package.json as per this issue.
What version of Remix are you using?
v1.18.0
Are all your remix dependencies & dev-dependencies using the same version?
Steps to Reproduce
npx create-remix@latest
npm install -D @vanilla-extract/css
root.css.ts
file with the following:root
styles inroot.tsx
:Expected Behavior
Remix would successfully build and display correct styles as per
root.css.ts
Actual Behavior
Build fails with the following error:
The text was updated successfully, but these errors were encountered: