-
Notifications
You must be signed in to change notification settings - Fork 6
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
vite:css require is not defined #66
Labels
bug
Something isn't working
Comments
I am not sure if this is the correct way to go about this, but it removes the error while hopefully keeping the CJS compatibility. const baseCssPath = typeof require !== 'undefined'
? require.resolve('tailwindcss/lib/css/preflight.css')
: new URL('../../tailwindcss/lib/css/preflight.css', import.meta.url); |
By the looks of it, Stackblitz is hard-locked to Node v18 which is far behind current usage and you cannot update it. Nonetheless, it seems that this issue may be related to tailwindlabs/tailwindcss#15374? |
FWIW, using this tailwind 4 + astro 5 example, this error shows up. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When attempting to use the plugin in Vite, vite errors during build from the plugin using the
require()
syntax.Using
commonjsOptions.transformMixedEsModules
does not work, presumably since this is outside of Vite's jurisdiction.To Reproduce
Code sandbox URL (any platform of your choice): TBD
Expected behaviour
The plugin to not block building.
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: