-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
"Uncaught ReferenceError: process is not defined" when importing "tailwindcss/resolveConfig" with Webpack 5 (v3.3.0) #10918
Comments
Hey! Thanks for reporting this. We actually just bumped into this issue ourselves while working on fixing something else. We've got a fix for this in #10919 👍 |
Hey thanks again for reporting this. This has been fixed and will be released as part of |
Thank you @reinink ! Will test ´v3.3.1´ when we get the chance and come back if we encounter any issues. Have a lovely day 👋 |
@rixyane Hey can you please share a minimal reproduction of this as a Git repo for us to test out? |
Solved with installing version 3.3.2 for me in React project using Vite. |
What version of Tailwind CSS are you using?
v3.3.0
What build tool (or framework if it abstracts the build tool) are you using?
Webpack 5.77.0
What version of Node.js are you using?
For example: v14.18.1
What browser are you using?
For example: Chrome
What operating system are you using?
For example: macOS (intel=
Describe your issue
After upgrading to tailwind v3.3.0 from v3.2.7 we got this warning at runtime, causing the app to fail from running
This was caused by one of our components import of
import resolveConfig from 'tailwindcss/resolveConfig'
with Webpack 5. Which causes the followingprocess.env
check to throw a runtime error.tailwindcss/src/lib/sharedState.js
Line 6 in b1f4da7
Apparently it's caused by Webpack 5's removal of polyfills.
There are workarounds for this such as including a
process
polyfill withwebpack.DefinePlugin
, but I think this should probably not be necessary.I wonder if this could be fixed by just adding a
typeof process !== 'undefined' &&
before it? We also got this issue as well on upgrading, so maybe they are related? Downgrading for now#10894
In case its relevant, we're mixing ESM modules with CommonJS, which is also similar in the bug above.
I'm sorry I don't have a runnable example, but I hope this information proves useful to fixing this.
The text was updated successfully, but these errors were encountered: