-
Notifications
You must be signed in to change notification settings - Fork 323
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
[BUG] Vite dev server hangs on initial page load #139
Comments
@frandiox Curious if you're seeing this and if you have any ideas! My initial thoughts:
|
Also, I am seeing some server components e.g. However, I refactored a bit and was still able to reproduce, so I don't think it's related. |
This kinda helps? import {defineConfig} from 'vite';
import hydrogen from '@shopify/hydrogen/plugin';
import shopifyConfig from './shopify.config';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [hydrogen(shopifyConfig)],
optimizeDeps: {
include: ['@headlessui/react'],
},
}); Since Not sure though. |
This only started happening later in the day on Friday so something related to Shopify/hydrogen#108 seems plausible 🤔 |
Confirmed that adding That gives us time to investigate the real issue which is: when Hydrogen's starter template includes dependencies that need optimization after they're loaded via e.g. client components, Vite attempts to refresh the page, and then the server stops responding, flat-out. Super mysterious. I added I don't think it was something introduced on Friday, it's just that we added |
@jplhomer I think this is not happening anymore even without the optiimizedDeps after Shopify/hydrogen#168 and Shopify/hydrogen#144 were merged so I'm closing this for now 👍 |
@Shahzaib342 I cannot reproduce this anymore. Can you try running the dev server with |
Hi @frandiox thanks for the reply. I tried "yarn dev --force" and also tried to change Hydrogen to 0.8.0. But still getting same issue. My node version is v16.13.1 and npm version is 8.2.0. I am following this documentation https://shopify.dev/custom-storefronts/hydrogen/getting-started on Ubuntu 20.04.3 LTS. This is what I am getting |
Tried same steps on windows and it worked. But it has to work on linux let me know if you find a work around? Note: On windows I also got the same error but just refreshing the page again fixed it. And everytime I create a new instance it gives me same error but refreshing it again fix it that's strange. |
For some reason, my laravel 9 project all of the sudden just keeps loading... i stashed all changes, and it continued? how can vite just blow up? ... it is something with vite.. |
migrate to using the released version of h-ui
Describe the bug
Vite's dev server seems to hang when running a fresh project. It seems to happen on the first page load, where the initial SSR response is returned, the client loads, and then Vite detects new dependencies so it starts a reload.
The page never fully seems to reload. Requests are hanging in the Network tab (see screenshot).
We also sometimes see errors related to headers being sent during streaming & the standard "Can't use Switch outside Router" which is usually a red herring #64
To Reproduce
Steps to reproduce the behaviour:
Expected behaviour
The dev server should start up and be snappy. Any dependency refreshes should happen instantly.
Screenshots
Additional context
Add any other context about the problem here. eg.
The text was updated successfully, but these errors were encountered: