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

First-run issues: Does not load some pages on first attempt #313

Closed
jluethi opened this issue Oct 11, 2023 · 5 comments · Fixed by #315
Closed

First-run issues: Does not load some pages on first attempt #313

jluethi opened this issue Oct 11, 2023 · 5 comments · Fixed by #315

Comments

@jluethi
Copy link
Collaborator

jluethi commented Oct 11, 2023

There's a weird behavior I've seen a few times in the past and now observed again when testing 0.6.0 (=> not new to 0.6.0):
When starting a fresh setup, sometimes the first time one clicks on certain pages, they don't load (they start loading, then send one back to the page one loaded from). The second time I load that page, everything works as expected.

For example: Create a project, submit a workflow. From the project page, go to the Jobs page. First time I do that, jobs page briefly flashes up, then project page reloads. Every following time, I get to the job page correctly.

Besides observing this in fresh installation, I don't have a way to reproduce it yet and not sure what exactly triggers this.

@jluethi
Copy link
Collaborator Author

jluethi commented Oct 11, 2023

Same happens the first time I try to open a workflow. Nothing suspicious in the log of server & web that I can see though

@zonia3000
Copy link
Collaborator

To reproduce this it is necessary to generate a new tag and restart the app.

You can notice that when you create a new workflow for the first time (and you are erroneously redirected back to the previous page) the Svelte logs displays the following:

[vite] ✨ new dependencies optimized: slim-select, marked, dompurify, semver, ajv
[vite] ✨ optimized dependencies changed. reloading

A similar thing happens when you try to list the jobs for the first time:

[vite] ✨ new dependencies optimized: @vincjo/datatables
[vite] ✨ optimized dependencies changed. reloading

So, it's vite that, when detects a new dependency inside the page, optimize it and then reload the page, causing the weird behavior.

This should happen only on dev mode, but since it could cause issues with automated tests I fixed it adding the following to the vite.config.js:

optimizeDeps: {
    include: ['slim-select', 'marked', 'dompurify', 'semver', 'ajv', '@vincjo/datatables']
}

More here:

I've tried to disable the feature at all instead of listing all the dependencies but it doesn't seem to work with our configuration:

Incompatible options: `prebundleSvelteLibraries: true` and vite `optimizeDeps.disabled: true`

@tcompa
Copy link
Collaborator

tcompa commented Oct 12, 2023

Thanks Sonia for the explanation, I understand at least a part of it ;)

Two quick comments:

  1. If you think it's useful, feel free to explore (with no special urgency) whether prebundleSvelteLibraries: true is needed/appropriate. I cannot recall any special reason for having it.
  2. The optimizeDeps.disabled option is marked as experimental, and it's not clear whether it will remain. Let's try to avoid it.

@zonia3000
Copy link
Collaborator

zonia3000 commented Oct 12, 2023

  1. If you think it's useful, feel free to explore (with no special urgency) whether prebundleSvelteLibraries: true is needed/appropriate. I cannot recall any special reason for having it.

Ok, I can have a look on it.

  1. The optimizeDeps.disabled option is marked as experimental, and it's not clear whether it will remain. Let's try to avoid it.

Docs says: "Dependency optimization is enabled by default in dev only." and "Optimizing dependencies in build mode is experimental.", so I think that disabling it in dev (by setting it to true) is not experimental. Only setting it to build is experimental. Do you agree?

@zonia3000
Copy link
Collaborator

As quickly discussed, optimizeDeps.disabled is marked as "Experimental: Give Feedback", so we can stay on the proposed solution that uses the include option.

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

Successfully merging a pull request may close this issue.

3 participants