tailwindlabs / tailwindcss

A utility-first CSS framework for rapid UI development.
https://tailwindcss.com/
MIT License
83.53k stars 4.23k forks source link

[V4] Windows + Nuxt + Vite: Pre-transform error: Cannot read properties of undefined (reading 'Sequential') #15157

Closed ManasMadrecha closed 5 days ago

ManasMadrecha commented 5 days ago

What version of Tailwind CSS are you using?

v4.0.0-beta.2

What build tool (or framework if it abstracts the build tool) are you using?

What version of Node.js are you using?

20.16.0

What browser are you using?

Edge

What operating system are you using?

Windows 11

Reproduction URL

This issue is related to #15156

New Nuxt app.


import tailwindcssVite from '@tailwindcss/vite'

export default defineNuxtConfig({
  // modules: [['../src/module', {}]],
  devtools: { enabled: true },
  compatibilityDate: '2024-11-21',
  css: ['~/assets/styles/tw.css'],
  // postcss: {
  //   plugins: {
  //     '@tailwindcss/postcss': {},
  //   },
  // },
  vite: {
    plugins: [tailwindcssVite()],
  },
})
// assets/styles/tw.css

@import "tailwindcss";

Describe your issue

Run the app. Got this Fatal error:


ERROR  Pre-transform error: Cannot read properties of undefined (reading 'Sequential')
RobinMalfait commented 5 days ago

Hey! Make sure you are using npm install @tailwindcss/postcss@next when installing the dependencies. Looks like you have a (very) old version installed (^0.0.0-development.1)

Once you install the dependencies using @next, these errors should go away.

Another confusing part is that you mention that you have installed @tailwindcss/postcss, but in the snippet you are using @tailwindcss/vite. Make sure you are using the correct packages.

Hope this helps!

ManasMadrecha commented 5 days ago

Thanks, yes installing next version solved it. Used the development version because that was shown as the latest in the IDE 😁

image