sveltejs / sapper

The next small thing in web development, powered by Svelte
https://sapper.svelte.dev
MIT License
7k stars 434 forks source link

Uncaught (in promise) TypeError: Cannot read property 'removeAttribute' of undefined #1729

Open MTyson opened 3 years ago

MTyson commented 3 years ago

I'm seeing the following error intermittently on prod build. When it occurs, the app stops responding. This is on Sapper 0.29.1.

client.c2a1e180.js:1 Uncaught (in promise) TypeError: Cannot read property 'removeAttribute' of undefined
    at N (client.c2a1e180.js:1)
    at Object.p (client.c2a1e180.js:172)
    at Se (client.c2a1e180.js:1)
    at Ce (client.c2a1e180.js:1)
N @ client.c2a1e180.js:1
p @ client.c2a1e180.js:172
Se @ client.c2a1e180.js:1
Ce @ client.c2a1e180.js:1
Promise.then (async)
ye @ client.c2a1e180.js:1
(anonymous) @ client.c2a1e180.js:1
(anonymous) @ client.c2a1e180.js:1
(anonymous) @ client.c2a1e180.js:172
r @ client.c2a1e180.js:1
P @ index.bf802bce.js:1
Ze @ client.c2a1e180.js:1
default @ index.bf802bce.js:1
ws @ client.c2a1e180.js:172
Es @ client.c2a1e180.js:172
c @ client.c2a1e180.js:1
hs @ client.c2a1e180.js:172
Ze @ client.c2a1e180.js:1
vs @ client.c2a1e180.js:172
Cs @ client.c2a1e180.js:172
Ze @ client.c2a1e180.js:1
Is @ client.c2a1e180.js:172
(anonymous) @ client.c2a1e180.js:187
s @ client.c2a1e180.js:187
Promise.then (async)
l @ client.c2a1e180.js:187
(anonymous) @ client.c2a1e180.js:187
Ls @ client.c2a1e180.js:187
da @ client.c2a1e180.js:187
(anonymous) @ client.c2a1e180.js:187
s @ client.c2a1e180.js:187
Promise.then (async)
l @ client.c2a1e180.js:187
(anonymous) @ client.c2a1e180.js:187
Ls @ client.c2a1e180.js:187
ua @ client.c2a1e180.js:187
(anonymous) @ client.c2a1e180.js:187
(anonymous) @ client.c2a1e180.js:187
Ls @ client.c2a1e180.js:187
Gs @ client.c2a1e180.js:187
(anonymous) @ client.c2a1e180.js:187
Promise.then (async)
(anonymous) @ client.c2a1e180.js:187
MTyson commented 3 years ago

I believe this is fallout from an attempt to work around #1725 , wherein I wrap my svg elements in {#if (process.browser)}.

So you can reproduce this by doing that to the repro from #1725.