-
Notifications
You must be signed in to change notification settings - Fork 4
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: Cannot read property 'parentNode' of undefined #36
Comments
I don't see an html wrapping around Please try
|
I added the missing html wrapping (just above). With your suggestion, I added :
But still get the same error message ... |
After deeper analysis, we found that the problem might come from We managed to get a green test by adding a delay in mountGauge and updateGauge. So it seems related to bootstrap workflow of Svelte components. Also the test works in Webstorm. |
Glad things are working for you. I'm closing this issue as it is not related to the library. |
We're using the speedometer in our app and great thanks for it.
We are unit testing with jest, and when we include the Speedometer in one svelte component, we have the following error :
When we follow the stack it leads to
mountGauge
:So
gaugeDiv
is undefined. We've seen the unit tests of svelte-speedometer, and we don't understand why it fails with our tests.Do you have an idea why gaugeDiv would not be bound ?
As @palerdot suggested, we rendered the speedometer inside a div, but the test still fails.
This is an extract of the Svelte file where we added Speedometer :
Here is the sample test code where we get the TypeError message :
The complete error message :
I guess the problem lies in the fact that we are using two components from different libraries on the same Svelte page and both having onMount() parts : Speedometer and our customized Confirm Button (with a popup from the lib PopperJs). But how can I be sure? Do you have any other ideas ?
The text was updated successfully, but these errors were encountered: