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

Build error after upgrade to 6.12.2 from 6.12.1 #909

Open
HADB opened this issue Oct 21, 2024 · 2 comments
Open

Build error after upgrade to 6.12.2 from 6.12.1 #909

HADB opened this issue Oct 21, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@HADB
Copy link

HADB commented Oct 21, 2024

Environment


  • Operating System: Darwin
  • Node Version: v20.16.0
  • Nuxt Version: 3.13.2
  • CLI Version: 3.13.2
  • Nitro Version: 2.9.7
  • Package Manager: pnpm@9.12.2
  • Builder: -
  • User Config: compatibilityDate, devtools, eslint, routeRules, nitro, css, site, modules, content, icon, colorMode, plausible, robots, sitemap, tailwindcss, sentry, gtag
  • Runtime Modules: @nuxt/content@2.13.4, @nuxt/eslint@0.6.0, @nuxt/icon@1.5.6, @nuxt/image@1.8.1, @nuxt/ui@2.18.7, @nuxtjs/color-mode@3.5.1, @nuxtjs/plausible@1.0.3, @nuxtjs/robots@4.1.9, @nuxtjs/sitemap@6.1.2, @nuxtjs/tailwindcss@6.12.2, @sentry/nuxt/module@8.34.0, nuxt-gtag@3.0.1
  • Build Modules: -

Reproduction

No response

Describe the bug

Build error after upgrade to 6.12.2 from 6.12.1

hadb.me git:(renovate/all-minor-patch) pnpm i
Lockfile is up to date, resolution step is skipped
Already up to date

> @ prepare /Users/bean/Projects/GitHub/HADB/hadb.me
> nuxt prepare

ℹ Using Tailwind CSS from ~/assets/css/tailwind.css                                                      nuxt:tailwindcss 11:15:26

[11:15:27]  WARN  Duplicated imports "useTrackEvent", the one from "/Users/bean/Projects/GitHub/HADB/hadb.me/node_modules/.pnpm/@nuxtjs+plausible@1.0.3_magicast@0.3.5_rollup@4.21.0_webpack-sources@3.2.3/node_modules/@nuxtjs/plausible/dist/runtime/composables/useTrackEvent" has been ignored and "/Users/bean/Projects/GitHub/HADB/hadb.me/node_modules/.pnpm/nuxt-gtag@3.0.1_magicast@0.3.5_rollup@4.21.0_webpack-sources@3.2.3/node_modules/nuxt-gtag/dist/runtime/composables/useTrackEvent" is used


 ERROR  Cannot destructure property 'theme' of 'undefined' as it is undefined.                                             11:15:27

  at typography (tailwind.config.ts:32:22)
  at node_modules/.pnpm/@nuxtjs+tailwindcss@6.12.2_magicast@0.3.5_rollup@4.21.0_webpack-sources@3.2.3/node_modules/@nuxtjs/tailwindcss/dist/module.mjs:135:18
  at _defu (node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs:31:19)
  at _defu (node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs:37:21)
  at _defu (node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs:37:21)
  at node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs:52:33
  at Array.reduce (<anonymous>)
  at node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs:52:16
  at configMerger (node_modules/.pnpm/@nuxtjs+tailwindcss@6.12.2_magicast@0.3.5_rollup@4.21.0_webpack-sources@3.2.3/node_modules/@nuxtjs/tailwindcss/dist/module.mjs:138:5)
  at configs.reduce.configMerger.content.files (node_modules/.pnpm/@nuxtjs+tailwindcss@6.12.2_magicast@0.3.5_rollup@4.21.0_webpack-sources@3.2.3/node_modules/@nuxtjs/tailwindcss/dist/module.mjs:249:23) 



 ERROR  Cannot destructure property 'theme' of 'undefined' as it is undefined.                                             11:15:27

 ELIFECYCLE  Command failed with exit code 1.

Additional context

No response

Logs

No response

@HADB HADB added the bug Something isn't working label Oct 21, 2024
@HADB
Copy link
Author

HADB commented Oct 21, 2024

My nuxt.config.ts:

...
  tailwindcss: {
    cssPath: ['~/assets/css/tailwind.css', { injectPosition: 'last' }],
    configPath: 'tailwind.config.ts',
  },
...

I found that everything goes well if I remove configPath: 'tailwind.config.ts', from nuxt.config.ts.

Maybe there are some breaking changes for this redundant config.

@ineshbose
Copy link
Collaborator

Thanks for raising this. I see the repository on your profile, and I'll try to investigate further.

You don't need to provide configPath if it is already tailwind.config (and maybe the path resolution behaves odd without path specifier eg relative or project dir root). Still, it shouldn't cause issues between versions.

From the traceback, I'm thinking if it's this line - https://github.com/nuxt-modules/tailwindcss/blob/main/src/runtime/merger.js#L34

Again, this wasn't changed between 6.12.1 and 6.12.2 but I notice that the if condition rather belongs in the earlier block (how did we miss that 😄). Let me continue investigating

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants