-
Notifications
You must be signed in to change notification settings - Fork 9
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
Issue building static storybook in 0.8.0 #60
Comments
This plugin doesn't call the |
Same issue here. But not only when running storybook, also when running normal build |
In a test env I just set up with v8, everything worked fine while building storybook. |
Aha! the error occurs when using the url string: const styles = stylex.create({
root: {
backgroundImage: 'url(/background.svg)',
// ^
},
}); ❯ pnpm build
> @ build /home/projects/remix-run-remix-tbable
> remix vite:build
vite v5.2.6 building for production...
✓ 83 modules transformed.
warnings when minifying css:
Unknown at rule: @stylex
rendering chunks (5)...
/assets/background.svg referenced in stylex.css didn't resolve at build time, it will remain unchanged to be resolved at runtime
x Build failed in 1.15s
TypeError: [vite-plugin-stylex] this.addWatchFile is not a function
at Object.transform (file:///home/projects/remix-run-remix-tbable/node_modules/.pnpm/vite@5.2.6_lightningcss@1.24.1/node_modules/vite/dist/node/chunks/dep-BBHrJRja.js:31569:26)
at async Object.generateBundle (file:///home/projects/remix-run-remix-tbable/node_modules/.pnpm/vite-plugin-stylex@0.8.1_@stylexjs+stylex@0.5.1_vite@5.2.6/node_modules/vite-plugin-stylex/dist/index.mjs:189:35)
at async Bundle.generate (file:///home/projects/remix-run-remix-tbable/node_modules/.pnpm/rollup@4.13.0/node_modules/rollup/dist/es/shared/node-entry.js:17967:9)
at async eval (file:///home/projects/remix-run-remix-tbable/node_modules/.pnpm/rollup@4.13.0/node_modules/rollup/dist/es/shared/node-entry.js:20504:27)
at async catchUnfinishedHookActions (file:///home/projects/remix-run-remix-tbable/node_modules/.pnpm/rollup@4.13.0/node_modules/rollup/dist/es/shared/node-entry.js:19932:16)
at async Module.build (file:///home/projects/remix-run-remix-tbable/node_modules/.pnpm/vite@5.2.6_lightningcss@1.24.1/node_modules/vite/dist/node/chunks/dep-BBHrJRja.js:67323:22)
at async viteBuild (file:///home/projects/remix-run-remix-tbable/node_modules/.pnpm/@remix-run+dev@2.8.1_@remix-run+serve@2.8.1_lightningcss@1.24.1_typescript@5.4.3_vite@5.2.6/node_modules/@remix-run/dev/dist/vite/build.js:212:5)
at async build (file:///home/projects/remix-run-remix-tbable/node_modules/.pnpm/@remix-run+dev@2.8.1_@remix-run+serve@2.8.1_lightningcss@1.24.1_typescript@5.4.3_vite@5.2.6/node_modules/@remix-run/dev/dist/vite/build.js:236:3)
at async Object.viteBuild (file:///home/projects/remix-run-remix-tbable/node_modules/.pnpm/@remix-run+dev@2.8.1_@remix-run+serve@2.8.1_lightningcss@1.24.1_typescript@5.4.3_vite@5.2.6/node_modules/@remix-run/dev/dist/cli/commands.js:183:5)
at async Object.run (file:///home/projects/remix-run-remix-tbable/node_modules/.pnpm/@remix-run+dev@2.8.1_@remix-run+serve@2.8.1_lightningcss@1.24.1_typescript@5.4.3_vite@5.2.6/node_modules/@remix-run/dev/dist/cli/run.js:252:7) {
code: 'PLUGIN_ERROR',
plugin: 'vite-plugin-stylex',
hook: 'generateBundle'
}
ELIFECYCLE Command failed with exit code 1. |
Same here: The problem comes from this code: const cssResult = await viteCssPlugin.transform?.call({}, stylexCSS, "stylex.css"); |
I think this will fix it: const cssResult = await viteCssPlugin.transform?.call(
this,
stylexCSS,
'stylex.css'
); |
Thank you all for the help! This is clearly going to keep happening so I'm going to release a small patch (0.8.2) and investigate how to use this new experimental API from Vite (vitejs/vite#16135) to make the plugin use the Vite pipeline for transforming CSS instead of this bunch of hacky things on |
Can confirm that the new version 0.9.0-next.0 has fixed this issue. |
Heyo. So when I updated to v0.8.0 I ran into an issue running
npm run build-storybook
. The build would fail with this error message:If I roll back to v 0.7.0 the build will run. Let me know if I can provide any other information. Thanks!
The text was updated successfully, but these errors were encountered: