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
I have problems to build a project in a monorepo. As soon I add @vanilla-extract/vite-plugin to my project the build throws errors. I set up a monorepo to reproduce the error. To set up Solid Start I create a symlink with the node_modules folder.
cd apps/page/app
ln -s ../../../node_modules/ node_modules
Then I can build the app with nx build page-app, which throws errors.
When I remove crawlLinks: true from the file app.config.ts there is no build error, but a runtime error. When I change the file .output/server/chunks/nitro/nitro.mjs:4369:33 to log the id and manifest, I see that the id is an absolute path, whereas the keys in the manifest are relative paths. When I set up a project without monorepo the ids are relative and everything works.
I tried to pin down the error and I could fix it partially when I replaced the tsconfig.json with a config without the key extends and removing the Button element form Counter.tsx. Then it builds, but when loading the page it can not find the javascript bundle for the same reason, that there is an absolute path. I created a branch for this.
The error persists even when I remove the Button element and the increment class from the file Counter.tsx. So that no actual .css.ts file is used. As soon I remove the vanilla extract plugin from vite plugins everything works.
Serving with nx serve page-app works without any problems. I also set up a normal solidjs app where building with nx build tool-app and serving with nx serve tool-app works as expected.
⚙ Preparing app for node-server...
✔ Generated public .output/public vinxi 10:06:29 AM
ℹ Initializing prerenderer vinxi 10:06:29 AM
ℹ Building Nitro Server (preset: nitro-prerender, compatibility date: ``) vinxi 10:06:29 AM
✔ Nitro Server built vinxi 10:06:30 AM
✔ You can preview this build using npx serve .output/public vinxi 10:06:30 AM
ℹ Prerendering 1 initial routes with crawler vinxi 10:06:30 AM
[nitro] [unhandledRejection] TypeError: Cannot read properties of undefined (reading 'file')
at Object.get (file:///home/playground/workspace/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected][email protected]_pkkifnsbod3b7nmoc7jpr5cmom/node_modules/vinxi/lib/manifest/prod-server-manifest.js:168:33)
at file:///home/playground/workspace/apps/page/app/.vinxi/prerender/chunks/nitro/nitro.mjs:1166:32
[nitro] [unhandledRejection] TypeError: Cannot read properties of undefined (reading 'file')
at Object.get (file:///home/playground/workspace/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected][email protected]_pkkifnsbod3b7nmoc7jpr5cmom/node_modules/vinxi/lib/manifest/prod-server-manifest.js:168:33)
at file:///home/playground/workspace/apps/page/app/.vinxi/prerender/chunks/nitro/nitro.mjs:1020:89
Validations
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Describe the bug
I have problems to build a project in a monorepo. As soon I add
@vanilla-extract/vite-plugin
to my project the build throws errors. I set up a monorepo to reproduce the error. To set upSolid Start
I create a symlink with thenode_modules
folder.Then I can build the app with
nx build page-app
, which throws errors.When I remove
crawlLinks: true
from the fileapp.config.ts
there is no build error, but a runtime error. When I change the file.output/server/chunks/nitro/nitro.mjs:4369:33
to log the id and manifest, I see that the id is an absolute path, whereas the keys in the manifest are relative paths. When I set up a project without monorepo the ids are relative and everything works.I tried to pin down the error and I could fix it partially when I replaced the
tsconfig.json
with a config without the keyextends
and removing theButton
element formCounter.tsx
. Then it builds, but when loading the page it can not find the javascript bundle for the same reason, that there is an absolute path. I created a branch for this.The error persists even when I remove the
Button
element and theincrement
class from the fileCounter.tsx
. So that no actual.css.ts
file is used. As soon I remove the vanilla extract plugin from vite plugins everything works.Serving with
nx serve page-app
works without any problems. I also set up a normalsolidjs
app where building withnx build tool-app
and serving withnx serve tool-app
works as expected.Reproduction
https://github.com/floratmin/monorepo-vanilla-extract-vite-plugin-bug
System Info
Used Package Manager
pnpm
Logs
Validations
The text was updated successfully, but these errors were encountered: