learn.svelte.dev icon indicating copy to clipboard operation
learn.svelte.dev copied to clipboard

Problem with editing after warnings/errors occur in specific circumstance

Open NanoUser3000 opened this issue 2 years ago • 1 comments
trafficstars

The problem occurs when in nested components tutorial I write <Nested/> at the last line (before doing anything else). Then editing is blocked there (just write this, wait for warning/squigglies to appear and you will see).

svelte-dev-bug in situation presented in the scrrenshot writing/backspacing with cursor in the squigglies doesn't do anything

The easiest way I found to fix the code now is to move cursor back a bit (before squigglies) and use delete button to delete what is ahead.

With this error on screen, similar problem occurs after writing something after closing brace of css rules. svelte-dev-bug-2 The problem becomes worse, as even the trick with delete key doesn't work. Trying to write/backspace around "a" (or anywhere below the line, which makes sense when looking at the error below) results in error like this in the console:

Uncaught (in promise) RangeError: Position 159 is out of range for changeset of length 155 at Xe.mapPos (5.06ffdf3b.js:4:5476) at El.map (5.06ffdf3b.js:5:2559) at se.map (5.06ffdf3b.js:5:4381) at Me.update [as updateF] (5.06ffdf3b.js:11:42592) at Object.update (5.06ffdf3b.js:4:16950) at te.computeSlot (5.06ffdf3b.js:4:25555) at Pn (5.06ffdf3b.js:4:19757) at new te (5.06ffdf3b.js:4:24801) at te.applyTransaction (5.06ffdf3b.js:4:25511) at get state [as state] (5.06ffdf3b.js:4:21217)

Reloading (using reload icon) results in the following in the console, and the above error after that:

[HMR][Svelte] Unrecoverable HMR error in <App>: next update will trigger a full reload logError @ proxy.js?v=4843b549:15 Proxy<App> @ proxy.js?v=4843b549:380 create_fragment @ +page.svelte:2 init @ chunk-3ICDZIIQ.js?v=4843b549:2167 Page @ +page.svelte:2 createProxiedComponent @ svelte-hooks.js?v=4843b549:341 ProxyComponent @ proxy.js?v=4843b549:242 Proxy<+page> @ proxy.js?v=4843b549:349 construct_svelte_component_dev @ chunk-3ICDZIIQ.js?v=4843b549:2586 create_default_slot @ root.svelte:42 create_slot @ chunk-3ICDZIIQ.js?v=4843b549:84 create_fragment @ layout.svelte?v=4843b549:22 init @ chunk-3ICDZIIQ.js?v=4843b549:2167 Layout @ layout.svelte?v=4843b549:98 createProxiedComponent @ svelte-hooks.js?v=4843b549:341 ProxyComponent @ proxy.js?v=4843b549:242 Proxy<Layout> @ proxy.js?v=4843b549:349 construct_svelte_component_dev @ chunk-3ICDZIIQ.js?v=4843b549:2586 create_if_block_2 @ root.svelte:41 create_fragment @ root.svelte:40 init @ chunk-3ICDZIIQ.js?v=4843b549:2167 Root @ root.svelte:20 createProxiedComponent @ svelte-hooks.js?v=4843b549:341 ProxyComponent @ proxy.js?v=4843b549:242 Proxy<Root> @ proxy.js?v=4843b549:349 initialize @ client.js?v=4843b549:285 navigate @ client.js?v=4843b549:1098 await in navigate (async) goto @ client.js?v=4843b549:227 goto @ client.js?v=4843b549:1353 start @ start.js:24 (anonymous) @ ?theme=dark:272 Promise.then (async) (anonymous) @ ?theme=dark:271 Show 4 more frames App.svelte?t=1689491672994:35 Uncaught (in promise) ReferenceError: Nested is not defined at create_fragment (App.svelte?t=1689491672994:35:2) at init (chunk-3ICDZIIQ.js?v=4843b549:2167:35) at new App (App.svelte:1:27) at createProxiedComponent (svelte-hooks.js?v=4843b549:341:9) at new ProxyComponent (proxy.js?v=4843b549:242:7) at new Proxy<App> (proxy.js?v=4843b549:349:11) at create_fragment (+page.svelte:2:35) at init (chunk-3ICDZIIQ.js?v=4843b549:2167:35) at new Page (+page.svelte:2:35) at createProxiedComponent (svelte-hooks.js?v=4843b549:341:9)

The 'console' tab in embedded IDE doesn't offer anything I should present here.

NanoUser3000 avatar Jul 16 '23 07:07 NanoUser3000

Writing <Nested/> not on the last line doesn't cause the bug to appear

NanoUser3000 avatar Jul 16 '23 07:07 NanoUser3000