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

svelte.dev not running script #623

Open
rushirufu opened this issue May 27, 2024 · 6 comments
Open

svelte.dev not running script #623

rushirufu opened this issue May 27, 2024 · 6 comments

Comments

@rushirufu
Copy link

Describe the bug

svelte.dev not running script

I'm lerning https://learn.svelte.dev/tutorial/tweens but all section not running scripts

I'm try to another browser (edge, mozilla, chrome) but not works

svelte_gg

Reproduction

svelte.dev not running script

Logs

svelte.dev not running script

System Info

svelte.dev not running script

Severity

annoyance

@Conduitry Conduitry transferred this issue from sveltejs/svelte May 27, 2024
@Conduitry
Copy link
Member

This is working currently for me.

@MikeBooon
Copy link

MikeBooon commented May 31, 2024

I am also having the same issue on multiple browsers.

Let me know if you need me to provide anymore information. I have disabled all extensions and cleared cache and cookies.

I am trying to debug this issue for a coworker so it also is not just my machine.

image

@Selyss
Copy link

Selyss commented Jun 12, 2024

I'm having the same issue.

@ARed99
Copy link

ARed99 commented Jun 17, 2024

it works for me.

@Osato28
Copy link

Osato28 commented Jun 20, 2024

Same here (macOS 14.5 on M1).

More detail:

  • on Chrome, the dev server for the tutorial is stuck on "booting webcontainer" seemingly forever (at least, it didn't shift in three minutes). REPL is working fine.
  • on Firefox, the dev server works for approximately 10-20 seconds but then it stops reading from the code that you're editing. Clicking "Solve" doesn't force the dev container to read from the new version of the code, neither does the "Refresh" button. REPL seems to be working fine here, too.
  • on Safari, it doesn't load at all and requests that the user enables third party cookies for the site (see screenshot). The really weird thing is that it doesn't happen every time; sometimes, it starts up just fine. Also, from the moment that request is shown, the entire system starts lagging until I close the tab. Couldn't test REPL because of connectivity problems (svelte.dev refuses my connections now, looks like an automated IP ban because I can reach it via a VPN).
Screenshot 2024-06-20 at 21 27 39

Additionally, the request shown on the screenshot offers the user to switch to a legacy version of the tutorial, which is no longer present under that URL. The legacy URL might be useful in tracing the bug, so here it is in plaintext:

https://svelte.dev/tutorial/welcome-to-svelte

@Osato28
Copy link

Osato28 commented Jun 20, 2024

Addendum: I self-hosted this repo on my computer to see if I can replicate the issue locally.

Attempts to replicate the issue succeeded with a 300% efficiency.

Now in all browsers, it has the same issue: stuck on "booting webcontainer". The issue is present whether you run the container via the script "dev" or via "preview".

Browser console shows nothing aside from CORS and connectivity errors (to be expected, since I'm still IP-banned from svelte.dev).

If the command used to run the server is "dev", no errors are displayed. If the command used to run the server is "preview", the following error is shown in the command line with every page refresh:

TypeError: immutable
    at _Headers.set (node:internal/deps/undici/undici:8616:17)
    at Object.handle (file:https:///Users/anonymized/Documents/GitHub/learn.svelte.dev/.svelte-kit/output/server/chunks/hooks.server.js:3:20)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async respond (file:https:///Users/anonymized/Documents/GitHub/learn.svelte.dev/.svelte-kit/output/server/index.js:2563:22)
    at async fetch (file:https:///Users/anonymized/Documents/GitHub/learn.svelte.dev/.svelte-kit/output/server/index.js:2320:26)
SvelteKitError: Not found: /_vercel/speed-insights/script.js
    at resolve2 (file:https:///Users/anonymized/Documents/GitHub/learn.svelte.dev/.svelte-kit/output/server/index.js:2732:18)
    at resolve (file:https:///Users/anonymized/Documents/GitHub/learn.svelte.dev/.svelte-kit/output/server/index.js:2565:34)
    at Object.handle (file:https:///Users/anonymized/Documents/GitHub/learn.svelte.dev/.svelte-kit/output/server/chunks/hooks.server.js:2:26)
    at respond (file:https:///Users/anonymized/Documents/GitHub/learn.svelte.dev/.svelte-kit/output/server/index.js:2563:43)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  status: 404,
  text: 'Not Found'

but that seems to be linked to a failed fetch of vercel's speed tracker ("at async fetch" in the middle), which is to be expected for a self-host on a local machine.


System parameters:
macOS 14.5 on M1
node v22.3.0
package managers used to build and host: pnpm 9.4.0 and yarn 1.22.19, each used separately on different copies of the repo.


UPD: fixed typos, improved readability


UPD2: Just when I despaired on getting it to run and booted up the server again to just read through the tutorial, the dev container on my local copy started to load and function correctly.

I believe I changed nothing in the setup, aside from running (and cutting short) the yarn check command instead of yarn run check.

It appears to have been working fine for the last ten minutes so long as I load one page at a time.

But when I launch several pages in parallel, only the most recent one's dev container is synchronized with the code editor: the rest stop updating if I update the code.


Question to consider: do devcontainers run on the server or on the client?

If it's on the server, then the unreliable operation of learn.svelte.dev's devcontainers might happen when Vercel hosting it runs fewer instances than there are concurrent connections and starts connecting several people to a single instance (which can be imitated for debugging purposes by self-hosting this repo and opening several pages at the same time).

If it's running on the client, then... maybe key collisions in localStorage or IndexedDB could be the problem? The hostname is the same, so different tabs should share the same data storage.

My intuition says "server". But I'm not well-versed in modern JS sorcery, so I can't exclude the possibility of running Svelte's compiler in a browser instead of node.

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

No branches or pull requests

6 participants