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

some "legacy svelte tutorial" links link to `500 not found` pages

Open m4rch3n1ng opened this issue 2 years ago • 5 comments

with third party cookies turned off, learn.svelte.dev gives you a "Yikes! We couldn't start the app" error with directions to enable cookies and a link to use the "legacy svelte tutorial"

image

the code for the <a /> tag just links to https://svelte.dev/tutorial/{$page.data.exercise.slug}

https://github.com/sveltejs/learn.svelte.dev/blob/b3b16664e390fef731c25ddfc0721622f35e9fdb/src/routes/tutorial/%5Bslug%5D/Loading.svelte#L71-L75

but since not all learn.svelte.dev pages have a svelte.dev/tutorial equivalent, some pages redirect to a 500 not found page instead. not sure if i found all, but (at least some of) these pages are:

  • https://learn.svelte.dev/tutorial/welcome-to-svelte => https://svelte.dev/tutorial/welcome-to-svelte
  • https://learn.svelte.dev/tutorial/your-first-component => https://svelte.dev/tutorial/your-first-component
  • https://learn.svelte.dev/tutorial/styles => https://svelte.dev/tutorial/styles
  • https://learn.svelte.dev/tutorial/component-styles => https://svelte.dev/tutorial/component-styles

image

(slightly unrelated side note: a 500 not found error is really weird and cryptic. is it supposed to be like that?)

m4rch3n1ng avatar Jul 03 '23 02:07 m4rch3n1ng

Best thing we can do here is to add the same stuff to legacy tutorial for the time being.

PuruVJ avatar Jul 04 '23 15:07 PuruVJ

you could also rename some of the legacy svelte tutorial pages

  • https://learn.svelte.dev/tutorial/welcome-to-svelte is basically equivalent to https://svelte.dev/tutorial/basics
  • https://learn.svelte.dev/tutorial/your-first-component is equivalent to https://svelte.dev/tutorial/adding-data
  • https://learn.svelte.dev/tutorial/styles is equivalent to https://svelte.dev/tutorial/style-directive
  • i don't think there is an equivalent to https://learn.svelte.dev/tutorial/component-styles tho

renaming tutorial pages seems like a pretty bad idea in my opinion, because i suspect that there are likely blogs or svelte introduction courses or whatever, that reference specific tutorial pages, but adding a redirect for those should work just fine i think?
or you could rename them and and add the old links as redirects

also i would consider renaming https://learn.svelte.dev/tutorial/styles to https://learn.svelte.dev/tutorial/style-directive so we wouldn't need the redirect for that one (and it's just a lot clearer), and i don't think it would break a lot if any links, as learn.svelte.dev is still relatively new

m4rch3n1ng avatar Jul 04 '23 16:07 m4rch3n1ng

how should I reproduce the following error ,When using the https://learn.svelte.dev/tutorial/welcome-to-sveltethe 500 error doesn't come for me

randomrahulm avatar Aug 09 '23 10:08 randomrahulm

All those links which have been mentioned is not giving any 500 error in my case, all those links works perfectly fine

randomrahulm avatar Aug 09 '23 10:08 randomrahulm

@randomrahulm the broken links are not the links to learn.svelte.dev, but instead their redirects to the legacy svelte tutorial.

to reproduce the issue, go into your browser settings and turn off / block third-party-cookes

for example on the https://learn.svelte.dev/tutorial/welcome-to-svelte page it tries to redirect you to https://svelte.dev/tutorial/welcome-to-svelte, which gives you a 500 not found.

i'll edit the original issue comment so it becomes clearer

m4rch3n1ng avatar Aug 10 '23 17:08 m4rch3n1ng