tailwindcss/resolveConfig causing an error with version 1.9.0

Created on 13 Oct 2020  路  5Comments  路  Source: tailwindlabs/tailwindcss

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

Most helpful comment

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

All 5 comments

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.

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.

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

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

Fixed in v1.9.1 馃憤馃徎

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dbpolito picture dbpolito  路  3Comments

Quineone picture Quineone  路  3Comments

Tjoosten picture Tjoosten  路  3Comments

nternetinspired picture nternetinspired  路  3Comments

jbardnz picture jbardnz  路  3Comments