Skip to content

Cannot read properties of undefined (reading 'call') on massive code change/format #19376

@njfamirm

Description

@njfamirm

What version of Tailwind CSS are you using?

"@tailwindcss/vite": "^4.1.17",
"tailwindcss": "^4.1.17",

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

For example: Astro 5.16.0


What version of Node.js are you using?

For example: v24.11.0

What browser are you using?

For example: N/A

What operating system are you using?

For example: macOS

Reproduction URL

https://stackblitz.com/edit/github-ihhy81u7

Describe your issue

Hi

This error occurs intermittently and repeatedly for me. Our project is extremely large and massive (high complexity, high volume of files/dependencies), and this error primarily appears when a significant code change (e.g., mass formatting or refactoring) or a branch switch.

The error shows up in the browser and the terminal, effectively stopping the HMR process. To fix it, I have to manually stop the development server and restart it.

Unfortunately, I couldn't find a pattern where you could see the exact error again, but minimum configs provided

Logs:


Stack Trace
TypeError: Cannot read properties of undefined (reading 'call')

at EnvironmentPluginContainer.transform (/node_modules/astro/node_modules/vite/dist/node/chunks/dep-D4NMHUTW.js:42324:19)
at async loadAndTransform (file:///home/nexim-0/projects/order-next/node_modules/astro/node_modules/vite/dist/node/chunks/dep-D4NMHUTW.js:35739:27)
at async fetchModule (node_modules/astro/node_modules/vite/dist/node/chunks/dep-D4NMHUTW.js:46858:16)
at async handleInvoke (file:///home/nexim-0/projects/order-next/node_modules/astro/node_modules/vite/dist/node/chunks/dep-D4NMHUTW.js:39002:22)
at async EventEmitter.listenerForInvokeHandler (file://node_modules/astro/node_modules/vite/dist/node/chunks/dep-D4NMHUTW.js:39075:19)

// another log:
13:19:59 Configuration file updated. Restarting...
13:19:59 [watch] astro.config.mjs
13:19:59 [watch] astro.config.mjs
13:19:59 [assets] Copying fonts (21 files)...
13:19:59 [ERROR] transport was disconnected, cannot call "fetchModule"
Stack trace:
at /home/nexim-0/projects/order-next/packages/admin/home/nexim-0/projects/order-next/node_modules/astro/node_modules/vite/dist/node/module-runner.js:548:17
[...] See full stack trace in the browser, or rerun with --verbose.
13:20:00 [vite] Re-optimizing dependencies because vite config has changed
13:20:00 [content] Syncing content
13:20:00 [content] Synced content
13:20:00 [types] Generated 618ms
13:20:00 [vite] Re-optimizing dependencies because vite config has changed
13:20:01 [200] /service-worker.js 21ms
13:20:02 [ERROR] Cannot read properties of undefined (reading 'call')
Stack trace:
at /home/nexim-0/projects/order-next/packages/admin/src/shared/ui/Header.tsx
[...] See full stack trace in the browser, or rerun with --verbose.
13:20:04 [200] /service-worker.js 1ms
📦 @alwatr/package-tracer v5.5.23
📦 @nexim/tailwind-material-colors v1.0.4
📦 global-config v7.34.2
📦 global-config v7.34.2
13:20:13 [ERROR] Cannot read properties of undefined (reading 'call')
Stack trace:
at /home/nexim-0/projects/order-next/packages/admin/src/app/layouts/Pure.astro?astro&type=script&index=0&lang.ts
[...] See full stack trace in the browser, or rerun with --verbose.
13:20:20 [ERROR] Cannot read properties of undefined (reading 'call')
Stack trace:
at /home/nexim-0/projects/order-next/packages/admin/src/shared/ui/Header.tsx
[...] See full stack trace in the browser, or rerun with --verbose.
13:20:22 [200] /service-worker.js 1ms

// and in verbose mode when configuration changed
vite:load 0.31ms [fs] ../../node_modules/astro/dist/runtime/server/transition.js +1ms
vite:resolve 0.09ms ../../transitions/index.js -> /home/nexim-0/projects/order-next/node_modules/astro/dist/transitions/index.js +6ms
vite:import-analysis 0.32ms [2 imports rewritten] /home/nexim-0/projects/order-next/node_modules/astro/dist/runtime/server/transition.js +2ms
vite:transform 0.45ms ../../node_modules/astro/dist/runtime/server/transition.js +2ms
vite:load 0.37ms [fs] ../../node_modules/astro/dist/transitions/index.js +4ms
vite:resolve 0.06ms ../runtime/server/transition.js -> /home/nexim-0/projects/order-next/node_modules/astro/dist/runtime/server/transition.js +3ms
vite:import-analysis 0.21ms [1 imports rewritten] /home/nexim-0/projects/order-next/node_modules/astro/dist/transitions/index.js +3ms
vite:transform 0.34ms ../../node_modules/astro/dist/transitions/index.js +3ms
vite:load 0.28ms [fs] /src/shared/ui/Header.tsx +1ms
astro:vite Error when evaluating SSR module /home/nexim-0/projects/order-next/packages/admin/src/pages/inventory.astro: Cannot read properties of undefined (reading 'call')
astro:vite Plugin: vite:react-babel
astro:vite File: /home/nexim-0/projects/order-next/packages/admin/src/shared/ui/Header.tsx
astro:vite at EnvironmentPluginContainer.transform (file:///home/nexim-0/projects/order-next/node_modules/astro/node_modules/vite/dist/node/chunks/dep-D4NMHUTW.js:42324:19)
astro:vite at async loadAndTransform (file:///home/nexim-0/projects/order-next/node_modules/astro/node_modules/vite/dist/node/chunks/dep-D4NMHUTW.js:35739:27) +5s
13:21:36 [ERROR] Cannot read properties of undefined (reading 'call')
Stack trace:
at EnvironmentPluginContainer.transform (file:///home/nexim-0/projects/order-next/node_modules/astro/node_modules/vite/dist/node/chunks/dep-D4NMHUTW.js:42324:19)
vite:time 264.06ms /inventory/ +0ms


Metadata

Metadata

Assignees

No one assigned

    Labels

    upstreamIssues that need to be fixed in upstream providers (e.g. lightningcss, vite, `@parcel/watcher`).

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions