Skip to content
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

tailwindcss/resolveConfig causing an error with version 1.9.0 #2547

Closed
haydencleary opened this issue Oct 13, 2020 · 5 comments · Fixed by #2548
Closed

tailwindcss/resolveConfig causing an error with version 1.9.0 #2547

haydencleary opened this issue Oct 13, 2020 · 5 comments · Fixed by #2548

Comments

@haydencleary
Copy link

Describe the problem:

After upgrading to tailwindcss 1.9.0 Next.js began throwing an error during development:

Screenshot 2020-10-13 at 11 38 21

I was able to narrow it down to components that use tailwindcss/resolveConfig to access the theme.
If I roll back to tailwindcss 1.8.13 everything works as expected.

Link to a minimal reproduction:

https://github.com/haydencleary/tailwind-issue

@schabluk
Copy link

schabluk commented Oct 13, 2020

Same here. Next has build-in CSS support, that allows 3rd party global CSS imports only from _app.js.

See here: https://nextjs.org/docs/basic-features/built-in-css-support#import-styles-from-node_modules

The workaround is to use legacy @zeit/next-css package, however if someone is using CSS Modules, this is no-go, because it allows to use either Global CSS, or CSS Modules, without mixing. Only build-in CSS support allows for using both, however the 3rd party has to be imported from _app.js.

@adamwathan
Copy link
Member

Weird, we don't actually import any CSS files so I'm not sure why this would happen, and nothing around this has changed between 1.8 and 1.9. Asked the Next team for some help tracing it down.

You can see here we're not actually importing any CSS, just resolving the path to the file on the filesystem:

https://github.com/tailwindlabs/tailwindcss/blob/master/src/plugins/preflight.js#L6

Though I do wonder why this code is even running at all when calling resolveConfig. Will try and trace that down, maybe that's what has changed.

@red545
Copy link

red545 commented Oct 13, 2020

Getting the same error after upgrading to 1.9 - really hard to pinpoint the source

@adamwathan
Copy link
Member

Will be fixed in a couple minutes after CI runs have no fear :)

@adamwathan
Copy link
Member

Fixed in v1.9.1 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants