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

Uncaught (in promise) TypeError: Cannot read property 'children' of null #5290

Closed
martonlederer opened this issue Aug 19, 2020 · 15 comments
Closed

Comments

@martonlederer
Copy link

martonlederer commented Aug 19, 2020

The bug
Navigating from a specific page to another causes Uncaught (in promise) TypeError: Cannot read property 'children' of null and a blank page. It only occurs when navigation from /app to /app/all-transactions (repo below). Going to the route directly or reloading does not cause this issue

Logs

VM9796:118 Uncaught (in promise) TypeError: Cannot read property 'children' of null
    at removeNode (<anonymous>:118:31)
    at Object.block.d (<anonymous>:280:11)
    at destroy (LatestTransactions.svelte:136)
    at updateProfile (<anonymous>:49:7)
    at Object.block.d (<anonymous>:283:9)
    at destroy_component (index.mjs:1396)
    at destroy (app.svelte:28)
    at updateProfile (<anonymous>:49:7)
    at Object.block.d (<anonymous>:283:9)
    at destroy_component (index.mjs:1396)

To Reproduce
Use this repository: https://github.com/useverto/verto

Information about your Svelte project:

  • Your browser and the version: Brave 1.10.97 Chromium: 83.0.4103.116 (Official Build) (64-bit)

  • Svelte version: latest ("^3.24.1")

  • Rollup

  • Using Sapper ("^0.28.0")

@martonlederer
Copy link
Author

Tried updating all rollup/svelte dependencies and tried this comment from #2086

@arggh
Copy link
Contributor

arggh commented Aug 23, 2020

I'm encountering possibly the same bug:

Uncaught TypeError: Cannot read property 'children' of undefined
    at removeNode (<anonymous>:118:31)
    at Object.block.d (<anonymous>:280:11)
    at destroy_component (modules.js?hash=241e361d86eb4a5c7deb890962cfc97e6c02b251:9785)
    at Confirm.$destroy (modules.js?hash=241e361d86eb4a5c7deb890962cfc97e6c02b251:9914)

Happens when I'm using a Dialog component that gets rendered as it's own "app" on the document.body, and then removed.

@arggh
Copy link
Contributor

arggh commented Aug 23, 2020

I was puzzled why this specific bit of our app was suddenly broken - haven't touched it, haven't updated Svelte, haven't done nothing but vacationing for three weeks.

I just tried to trigger the bug with Firefox, but I can't. It works. It also works on Safari. And Brave.

So, my suggestion is... Chrome pushed out a new release that broke Svelte? 😬

@arggh
Copy link
Contributor

arggh commented Aug 23, 2020

I think my guess was correct.

The previous version of Chrome on my laptop was 83.0.4103.116.

I now updated to 84.0.4147.135 and the error disappeared 🤷‍♂️

@martonlederer
Copy link
Author

No idea. I'm using brave and it throws the error. Brave uses chromium

@arggh
Copy link
Contributor

arggh commented Aug 23, 2020

No idea. I'm using brave and it throws the error. Brave uses chromium

Have you tried Firefox, Safari, Opera etc. to rule out the possibility that your Brave browser is using a version of Chromium that has the same (potential) bug that I (think I) had?

@martonlederer
Copy link
Author

I will make sure to do so

@Thijsrausch
Copy link

Not sure what is the cause of the bug, but I have the same problem in the latest Chrome, latest Firefox (80.0.1) and latest Edge 85.0.564.51 (but that's Chromium as well). I don't think it is an issue with browsers.

@Thijsrausch
Copy link

The answer to this related stackoverflow question solved my problem, maybe it can help you guys as well.

@gijswobben
Copy link

Same issue here. I'm not using Sapper, just Svelte. I'm using page for routing, but even with plain <a href="/somepath" ... it's not working... Only for specific routes though. I haven't been able to pinpoint the issue so far, any help is appreciated!

@newtriks
Copy link

newtriks commented Dec 6, 2020

I've been having this issue in various instances also, typically within if blocks (and font-awesome for example) or using slots. #5290 (comment) SO solution seems to work 🙏 but it's nay cool.

DegradingGracefully pushed a commit to DegradingGracefully/prototype-simple-time-tracker-client that referenced this issue May 3, 2021
* added a "play" and "stop" button, to launch the task, and to stop tracking it
* these buttons are necessary in order to be able to tell if the task is currently being tracked or not
* had to add a volatile "isTracking" field on the task model
* had to deal with a vicious bug in Todo.svelte. The play / stop font awesome icon, conditionally rendered by svelte, was crashing the app. Had to add an additional container span. cf    sveltejs/svelte#5290 (comment) and https://stackoverflow.com/questions/58768701/sapper-how-do-i-fix-parentnode-is-null-when-navigating-away-from-a-page-with
* layout => moved the play / stop icon before the task title
@jiangfengming
Copy link

I removed the Svelte Devtools and solved.

@stale
Copy link

stale bot commented Nov 17, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale-bot label Nov 17, 2021
@stale
Copy link

stale bot commented Dec 1, 2021

This issue has been closed as it was previously marked as stale and saw no subsequent activity.

@stale stale bot closed this as completed Dec 1, 2021
@NsdHSO
Copy link

NsdHSO commented Oct 5, 2023

I removed the Svelte Devtools and solved.

But we need the svelte devtools. how to proceed to stop getting this error.

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

No branches or pull requests

7 participants