exposeConfig with specific part is undefined
See original GitHub issueVersion
@nuxtjs/tailwindcss: 5.0.3 nuxt: 2.15.8
Steps to reproduce
Set exposeConfig
to true
in nuxt.config.js
export default {
tailwindcss: {
exposeConfig: true
}
}
Import theme
from configuration in component.
import { theme } from '#tailwind-config'
What is Expected?
Expecting theme
to be defined.
What is actually happening?
theme
is undefined.
When importing the full configuration, I can get the theme
field.
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:6 (2 by maintainers)
Top Results From Across the Web
exposeConfig with specific part is undefined · Issue #481
Set exposeConfig to true in nuxt.config.ts . When trying to create util method, I'm importing theme the way the doc says : import ......
Read more >Nested Nuxt + Tailwind (Please enable a CSS ...
As Dmitry himself mentioned in the comments, to fix this problem, 'tailwindcss/nesting': {} should be added to postcss plugins in the build ...
Read more >Config - Nuxt Tailwind
This module comes with a default Tailwind configuration file to provide the best possible user experience.
Read more >Using Environment Variables in Python for App Configuration ...
Set environment specific database variables such as DB_USER and DB_PASSWORD so database credentials are not hard-coded. How are environment ...
Read more >react-native-config
Module to expose config variables to your javascript code in React Native, supporting iOS, Android and Windows.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The only way to make this work currently is to import the fully resolved config like this:
I think the issue may be somewhere here? https://github.com/nuxt-modules/tailwindcss/blob/4781e6d3f5453237879c81c74ca08ce92be9b6e1/src/module.ts#L151-L154
I don’t see a
tailwind.config.mjs
generated in my.nuxt
directory. Could investigate for a PR.Edit: it seems to be missing
write: True
, I’ll open a PR