question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

exposeConfig with specific part is undefined

See original GitHub issue

Version

@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:closed
  • Created a year ago
  • Reactions:3
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
hacknugcommented, Aug 16, 2022

The only way to make this work currently is to import the fully resolved config like this:

import tailwindConfig from '#tailwind-config'
0reactions
ineshbosecommented, Dec 13, 2022

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found