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

TypeError in New Project (Svelte) #355

Closed
6 tasks done
lorenzolewis opened this issue Nov 12, 2022 · 4 comments
Closed
6 tasks done

TypeError in New Project (Svelte) #355

lorenzolewis opened this issue Nov 12, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@lorenzolewis
Copy link
Contributor

Describe the bug

When creating a Svelte (not SvelteKit, although the same happens) and then installing Histoire, the following error message appears upon creating your first story:

Error while collecting story /Users/lorenzolewis/Developer/histoire-svelte-test/src/lib/Counter.story.svelte:
TypeError: Cannot set property target of #<Event> which has only a getter
    at EventTarget.dispatchEvent (/Users/lorenzolewis/Developer/histoire-svelte-test/node_modules/happy-dom/lib/event/EventTarget.js:42:26)
    at /Users/lorenzolewis/Developer/histoire-svelte-test/node_modules/svelte-hmr/runtime/proxy.js:310:10
    at async ViteNodeRunner.directRequest (file:///Users/lorenzolewis/Developer/histoire-svelte-test/node_modules/vite-node/dist/client.mjs:251:5)
    at async ViteNodeRunner.cachedRequest (file:///Users/lorenzolewis/Developer/histoire-svelte-test/node_modules/vite-node/dist/client.mjs:128:12)
    at async request (file:///Users/lorenzolewis/Developer/histoire-svelte-test/node_modules/vite-node/dist/client.mjs:151:16)
    at async /Users/lorenzolewis/Developer/histoire-svelte-test/node_modules/svelte-hmr/runtime/hot-api.js:3:31
    at async ViteNodeRunner.directRequest (file:///Users/lorenzolewis/Developer/histoire-svelte-test/node_modules/vite-node/dist/client.mjs:251:5)
    at async ViteNodeRunner.cachedRequest (file:///Users/lorenzolewis/Developer/histoire-svelte-test/node_modules/vite-node/dist/client.mjs:128:12)
    at async request (file:///Users/lorenzolewis/Developer/histoire-svelte-test/node_modules/vite-node/dist/client.mjs:151:16)
    at async /Users/lorenzolewis/Developer/histoire-svelte-test/node_modules/svelte-hmr/runtime/index.js:1:238

I've tried this with npm, yarn, and pnpm and have the same results for each

Reproduction

Install Svelte, install Histoire, create a story following the guide for svelte, and then try to run.

Reproduction: https://github.com/lorenzolewis/histoire-svelte-test

System Info

System:
    OS: macOS 13.0.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 50.81 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 19.0.1 - /opt/homebrew/bin/node
    npm: 8.19.2 - /opt/homebrew/bin/npm
  Browsers:
    Safari: 16.1
  npmPackages:
    @histoire/plugin-svelte: ^0.11.7 => 0.11.7 
    histoire: ^0.11.7 => 0.11.7 
    vite: ^3.2.3 => 3.2.3

Used Package Manager

npm

Validations

@lorenzolewis lorenzolewis added the to triage This issue needs to be triaged label Nov 12, 2022
@lorenzolewis
Copy link
Contributor Author

Did some more digging into this, when I'm using node LTS (18.12.1) I don't run into this issue. It's only when I'm using the latest version of node (19.0.1).

@endigma
Copy link

endigma commented Nov 20, 2022

Can reproduce, observing the same node version issue using asdf.

@Akryum
Copy link
Member

Akryum commented Dec 2, 2022

Looks like it's an issue with happy-dom

@Akryum Akryum added bug Something isn't working and removed to triage This issue needs to be triaged labels Dec 2, 2022
@Akryum Akryum self-assigned this Dec 2, 2022
Akryum added a commit that referenced this issue Dec 2, 2022
@benmccann
Copy link
Contributor

Should this issue be closed as fixed by e4213d3 ?

@Akryum Akryum closed this as completed Feb 5, 2023
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

4 participants