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

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

Open
ambrt opened this issue Jan 24, 2025 · 2 comments
Open

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

ambrt opened this issue Jan 24, 2025 · 2 comments
Labels
awaiting submitter needs a reproduction, or clarification

Comments

@ambrt
Copy link

ambrt commented Jan 24, 2025

Describe the bug

It works in browser and Astro's npm run dev .
I'm getting this error when trying to test with Vitest of Astro page with svelte file.

TypeError: Cannot read properties of undefined (reading 'call')
 
// edited - moved to Logs section

Reproduction

If required then later might try to repro. Its big page with runes, functions passed as props and template.
EDIT:
https://stackblitz.com/edit/github-ch9tapzs?file=test%2Fhappy-dom-env.test.ts&on=stackblitz
After dependencies install, stop npm in terminal and run npm run test

Logs

TypeError: Cannot read properties of undefined (reading 'call')
 ❯ get_first_child node_modules/svelte/src/internal/client/dom/operations.js:81:28
     80| /**
     81|  * @template {Node} N
     82|  * @param {N} node
       |      ^
     83|  * @returns {Node | null}
     84|  */
 ❯ eval node_modules/svelte/src/internal/client/dom/template.js:48:91
 ❯ eval node_modules/svelte/src/internal/client/dev/elements.js:13:15
 ❯ Test src/components/test.svelte:15:12
 ❯ render node_modules/svelte/src/internal/server/index.js:121:2
 ❯ Object.renderToStaticMarkup node_modules/@astrojs/svelte/server.js:45:49
 ❯ renderFrameworkComponent node_modules/astro/dist/runtime/server/render/component.js:189:68
 ❯ renderComponent node_modules/astro/dist/runtime/server/render/component.js:368:10

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
    CPU: (2) x64 Intel(R) Core(TM)2 Duo CPU     E4500  @ 2.20GHz
    Memory: 464.32 MB / 3.82 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 10.2.4 - ~/.nvm/versions/node/v20.11.1/bin/npm
    pnpm: 9.15.2 - ~/.local/share/pnpm/pnpm
    bun: 1.1.6 - ~/.bun/bin/bun
    Watchman: 20201115.021953.0 - /usr/local/bin/watchman
  Browsers:
    Chrome: 132.0.6834.83
  npmPackages:
    svelte: ^5.1.3 => 5.16.2

Severity

blocking all usage of svelte

@Conduitry Conduitry added the awaiting submitter needs a reproduction, or clarification label Jan 24, 2025
@Conduitry
Copy link
Member

A reproduction is required, yes.

@ambrt
Copy link
Author

ambrt commented Jan 26, 2025

Error happens in happy-dom and jsdom environments:

https://stackblitz.com/edit/github-ch9tapzs?file=test%2Fhappy-dom-env.test.ts&on=stackblitz
(After dependencies install, stop npm in terminal and run npm run test)

JSDom, throws same error as happy-dom , but since stackblitz has node v18, JSDom would fail with non svelte related issue.
So only happy-dom test is in the repro.

Test passes in plain node environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting submitter needs a reproduction, or clarification
Projects
None yet
Development

No branches or pull requests

2 participants