Skip to content

Cannot read properties of undefined (reading 'call') #21162

@njfamirm

Description

@njfamirm

Describe the bug

Hi, I'm use vite in astro and create an issue in both astro and tailwind to find solution

This error occurs intermittently and repeatedly for me. Our projects, 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

all of my dependency in latest version, and this issue exists from a long time ago

tailwindlabs/tailwindcss#19376
withastro/astro#14868

Reproduction

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

Steps to reproduce

Can't normally reproduce, because happen some timesو If I find out, I'll definitely comment.

System Info

System:
    OS: Linux 6.17 Fedora Linux 43 (Workstation Edition)
    CPU: (6) x64 Intel(R) Core(TM) i5-8500 CPU @ 3.00GHz
    Memory: 8.09 GB / 15.39 GB
    Container: Yes
    Shell: 5.3.0 - /bin/bash
  Binaries:
    Node: 24.11.0 - /home/nexim-0/.nvm/versions/node/v24.11.0/bin/node
    Yarn: 4.11.0 - /home/nexim-0/.nvm/versions/node/v24.11.0/bin/yarn
    npm: 11.6.1 - /home/nexim-0/.nvm/versions/node/v24.11.0/bin/npm
  Browsers:
    Chrome: 144.0.7534.0

Also in my Mac

Used Package Manager

yarn

Logs

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


Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions