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 · 7 comments
Open

Build error after upgrade to 6.12.2 from 6.12.1 #909

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

Comments

@HADB
Copy link

HADB commented Oct 21, 2024

Environment



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/@[email protected][email protected][email protected][email protected]/node_modules/@nuxtjs/plausible/dist/runtime/composables/useTrackEvent" has been ignored and "/Users/bean/Projects/GitHub/HADB/hadb.me/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/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/@[email protected][email protected][email protected][email protected]/node_modules/@nuxtjs/tailwindcss/dist/module.mjs:135:18
  at _defu (node_modules/.pnpm/[email protected]/node_modules/defu/dist/defu.mjs:31:19)
  at _defu (node_modules/.pnpm/[email protected]/node_modules/defu/dist/defu.mjs:37:21)
  at _defu (node_modules/.pnpm/[email protected]/node_modules/defu/dist/defu.mjs:37:21)
  at node_modules/.pnpm/[email protected]/node_modules/defu/dist/defu.mjs:52:33
  at Array.reduce (<anonymous>)
  at node_modules/.pnpm/[email protected]/node_modules/defu/dist/defu.mjs:52:16
  at configMerger (node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@nuxtjs/tailwindcss/dist/module.mjs:138:5)
  at configs.reduce.configMerger.content.files (node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/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

@letoast
Copy link

letoast commented Nov 26, 2024

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

Hey, @ineshbose any update on this? We've upgraded nuxt/ui which depends on @nuxtjs/tailwindcss and now we have to lock the version of tailwindcss via resolutions.

@ineshbose
Copy link
Collaborator

It's possible that #913 could address this as it is changing config-loading strategy. Once merged, I shall be asking for feedback!

@ineshbose
Copy link
Collaborator

Merged! Could you give nightly a try and let me know how it goes please?

https://tailwindcss.nuxtjs.org/getting-started/installation#opting-into-the-nightly-channel

@ineshbose
Copy link
Collaborator

Hey @HADB @letoast would you be able to test and provide feedback if the issue has been fixed please?

@HADB
Copy link
Author

HADB commented Dec 9, 2024

@ineshbose I ran into another error with the nightly version:

 ERROR  x Build failed in 3.09s                                                                                                   10:32:57


[10:32:57]  ERROR  Nuxt Build Error: [vite:load-fallback] Could not load /Users/bean/Projects/GitHub/HADB/hadb.me/.nuxt/tailwind.config/theme/colors (imported by node_modules/.pnpm/@[email protected][email protected][email protected][email protected]_@[email protected][email protected]_terser_ex2undgjgyscydumoact7e7atu/node_modules/@nuxt/ui/dist/runtime/plugins/colors.js): ENOENT: no such file or directory, open '/Users/bean/Projects/GitHub/HADB/hadb.me/.nuxt/tailwind.config/theme/colors'

  at async open (node:internal/fs/promises:638:25)
  at async Object.readFile (node:internal/fs/promises:1238:14)
  at async Object.load (node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-DG6Lorbi.js:65033:25)
  at async PluginDriver.hookFirstAndGetPlugin (node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:19813:28)
  at async node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:18977:33
  at async Queue.work (node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:20023:32)

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

3 participants