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

Getting an error while running in vitest #256

Open
hagai-reuveni opened this issue Nov 24, 2022 · 4 comments
Open

Getting an error while running in vitest #256

hagai-reuveni opened this issue Nov 24, 2022 · 4 comments

Comments

@hagai-reuveni
Copy link

hagai-reuveni commented Nov 24, 2022

Hey,
I keep getting the next error message when trying to use svelte-htm (running vitest).
Rendering a simple component via @testing-library/svelte

 const noDataMessage = 'no data';
    render(html`
      <${DataLoadingPane} loading=${false} noDataMessage=${noDataMessage}>data</${DataLoadingPane}>`);

[email protected]
[email protected]

TypeError: Cannot read properties of undefined (reading '$$')
❯ Module.init node_modules/.pnpm/[email protected]/node_modules/svelte/internal/index.mjs:1992:50
    |         dirty,
    |         skip_bound: false,
    |         root: options.target || parent_component.$$.root
       |                                                  ^
    |     };
  |     append_styles && append_styles($$.root);

Appreciate any help.
Thanks

@rburnham-def
Copy link

I'm seeing the same error, did you figure it out?

@wd-David
Copy link

After bumping packages in my davipon/svelte-component-test-recipes repo, the error has gone and CI is passing.

@rburnham-def
Copy link

I did try updating some packages but didn't have any luck, I'll take a look at what you changed, thanks.

@hmajid2301
Copy link

After bumping packages in my davipon/svelte-component-test-recipes repo, the error has gone and CI is passing.

This also fixed the issue for me, I did have to re-run vitest for it to pick up the new vitest version. Then my tests started to pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants