-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix(dev): vite base and qrl segment fixes #6629
Conversation
wmertens
commented
Jul 1, 2024
- fixes nx monorepo path lookup in dev mode
- fix vite prefix for css etc
- fix qrl segment path encoding for windows in dev mode
- only pass parent filename since path is always the same
- simplify resolveId path handling
- change starter to only add service worker in production
- add base url to manifest
👷 Deploy Preview for qwik-insights processing.
|
✅ Deploy Preview for qwik-insights ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Deploying qwik-docs with
|
Latest commit: |
f086139
|
Status: | ✅ Deploy successful! |
Preview URL: | https://56a44c4d.qwik-8nx.pages.dev |
Branch Preview URL: | https://fix-dev.qwik-8nx.pages.dev |
commit: @builder.io/qwik
@builder.io/qwik-city
eslint-plugin-qwik
create-qwik
|
8c52dfd
to
ab68b91
Compare
How long can this be taken till the pull request is accepted and we can easy use this fix? It's only a question. If it takes longer I will migrate my real project from npm to pnpm. Because I only can use the fix with pnpm or how it is possible with npm? This fix does not solve all off my useOn... problems but a lot. |
@frankroc2022 it seems in good shape now, I'd just like some more confirmations that it works for everyone |
@frankroc2022 in meantime you can use the continuous build created from this PR. We structured a multi steps approval inside of the core team to reduce regressions like the one we had with v1.6.0. |
@wmertens I've used the continuous build, but I get this error: For reference, I've added a clickable div:
|
Just tried this version. Got the following error: Here are some logs with DetailsQwik Speak Resolved locale: pt
[QWIK PLUGIN: 804] load() Not found C:/src/github/milkyway/web/i18n/pt/app.json
[QWIK PLUGIN: 804] load() Not found C:/src/github/milkyway/web/i18n/pt/home.json
[QWIK PLUGIN: 804] load() Not found C:/src/github/milkyway/web/i18n/pt/listing.json
[QWIK PLUGIN: 804] load() Not found C:/src/github/milkyway/web/i18n/pt/product.json
[QWIK PLUGIN: 804] load() Not found C:/src/github/milkyway/web/i18n/pt/runtime.json
[QWIK PLUGIN: 804] transform() Not transforming C:/src/github/milkyway/web/i18n/pt/app.json
[QWIK PLUGIN: 804] transform() Not transforming C:/src/github/milkyway/web/i18n/pt/home.json
[QWIK PLUGIN: 804] transform() Not transforming C:/src/github/milkyway/web/i18n/pt/product.json
[QWIK PLUGIN: 804] transform() Not transforming C:/src/github/milkyway/web/i18n/pt/listing.json
[QWIK PLUGIN: 804] transform() Not transforming C:/src/github/milkyway/web/i18n/pt/runtime.json
[QWIK PLUGIN: 804] resolveId(824) Start /@fs/C:/src/github/milkyway/web/node_modules/vite/dist/client/client.mjs { from:
'C:\\src\\github\\milkyway\\web\\index.html', for: 'client' }
[QWIK PLUGIN: 804] resolveId(824) Not resolved /C:/src/github/milkyway/web/node_modules/vite/dist/client/client.mjs C:/src/github/milkyway/web/index.html
[QWIK PLUGIN: 804] resolveId(825) Start /@fs/C:/src/github/milkyway/web/node_modules/vite/dist/client/client.mjs { from:
'C:\\src\\github\\milkyway\\web\\index.html', for: 'client' }
[QWIK PLUGIN: 804] resolveId(825) Not resolved /C:/src/github/milkyway/web/node_modules/vite/dist/client/client.mjs C:/src/github/milkyway/web/index.html
[QWIK PLUGIN: 804] load() Not found C:/src/github/milkyway/web/node_modules/vite/dist/client/client.mjs
[QWIK PLUGIN: 804] transform() Not transforming C:/src/github/milkyway/web/node_modules/vite/dist/client/client.mjs
[QWIK PLUGIN: 804] resolveId(826) Start /@fs/C:/src/github/milkyway/web/node_modules/vite/dist/client/env.mjs {
from: 'C:/src/github/milkyway/web/node_modules/vite/dist/client/client.mjs',
for: 'client'
}
[QWIK PLUGIN: 804] resolveId(826) Not resolved /@fs/C:/src/github/milkyway/web/node_modules/vite/dist/client/env.mjs C:/src/github/milkyway/web/node_modules/vite/dist/client/client.mjs
[QWIK PLUGIN: 804] load() Not found C:/src/github/milkyway/web/node_modules/vite/dist/client/env.mjs
[QWIK PLUGIN: 804] transform() Not transforming C:/src/github/milkyway/web/node_modules/vite/dist/client/env.mjs
[QWIK PLUGIN: 804] resolveId(827) Start /%40fsC%3A\src\github\milkyway\web\src/root_component_useondocument_p6osfoenwte.js?_qrl_parent=root.tsx { from: 'C:\\src\\github\\milkyway\\web\\index.html', for: 'client' }
[QWIK PLUGIN: 804] resolveId(827) Resolved C:/src/github/milkyway/web/@fsC:/src/github/milkyway/web/src/root_component_useondocument_p6osfoenwte.js from transformedOutputs
[QWIK PLUGIN: 804] resolveId(828) Start /%40fsC%3A\src\github\milkyway\web\src/root_component_useondocument_p6osfoenwte.js?_qrl_parent=root.tsx { from: 'C:\\src\\github\\milkyway\\web\\index.html', for: 'client' }
[QWIK PLUGIN: 804] resolveId(828) Resolved C:/src/github/milkyway/web/@fsC:/src/github/milkyway/web/src/root_component_useondocument_p6osfoenwte.js from transformedOutputs
[QWIK PLUGIN: 804] load() transforming QRL parent C:/src/github/milkyway/web/@fsC:/src/github/milkyway/web/src/root.tsx
[QWIK PLUGIN: 804] resolveId(829) Start C:/src/github/milkyway/web/@fsC:/src/github/milkyway/web/src/root.tsx { from: 'C:\\src\\github\\milkyway\\web\\index.html', for: 'client' }
[QWIK PLUGIN: 804] resolveId(829) falling back to default resolver
[QWIK PLUGIN: 804] resolveId(830) Start C:/src/github/milkyway/web/@fsC:/src/github/milkyway/web/src/root.tsx { from: 'C:\\src\\github\\milkyway\\web\\index.html', for: 'client' }
[QWIK PLUGIN: 804] resolveId(830) falling back to default resolver
[QWIK PLUGIN: 804] load() Not found C:/src/github/milkyway/web/@fsC:/src/github/milkyway/web/src/root.tsx
[QWIK PLUGIN: 804] resolveId(831) Start /%40fsC%3A\src\github\milkyway\web\node_modules\qwik-speak\lib/useqwikspeak_resumecontext_6bh92hvek8o.js?_qrl_parent=use-qwik-speak.qwik.mjs { from: 'C:\\src\\github\\milkyway\\web\\index.html', for: 'client' }
[QWIK PLUGIN: 804] resolveId(831) Resolved C:/src/github/milkyway/web/@fsC:/src/github/milkyway/web/node_modules/qwik-speak/lib/useqwikspeak_resumecontext_6bh92hvek8o.js from transformedOutputs
[QWIK PLUGIN: 804] resolveId(832) Start /%40fsC%3A\src\github\milkyway\web\node_modules\qwik-speak\lib/useqwikspeak_resumecontext_6bh92hvek8o.js?_qrl_parent=use-qwik-speak.qwik.mjs { from: 'C:\\src\\github\\milkyway\\web\\index.html', for: 'client' }
[QWIK PLUGIN: 804] resolveId(832) Resolved C:/src/github/milkyway/web/@fsC:/src/github/milkyway/web/node_modules/qwik-speak/lib/useqwikspeak_resumecontext_6bh92hvek8o.js from transformedOutputs
[QWIK PLUGIN: 804] load() transforming QRL parent C:/src/github/milkyway/web/@fsC:/src/github/milkyway/web/node_modules/qwik-speak/lib/use-qwik-speak.qwik.mjs
[QWIK PLUGIN: 804] resolveId(833) Start C:/src/github/milkyway/web/@fsC:/src/github/milkyway/web/node_modules/qwik-speak/lib/use-qwik-speak.qwik.mjs { from: 'C:\\src\\github\\milkyway\\web\\index.html', for: 'client' }
[QWIK PLUGIN: 804] resolveId(833) falling back to default resolver
[QWIK PLUGIN: 804] resolveId(834) Start C:/src/github/milkyway/web/@fsC:/src/github/milkyway/web/node_modules/qwik-speak/lib/use-qwik-speak.qwik.mjs { from: 'C:\\src\\github\\milkyway\\web\\index.html', for: 'client' }
[QWIK PLUGIN: 804] resolveId(834) falling back to default resolver
[QWIK PLUGIN: 804] load() Not found C:/src/github/milkyway/web/@fsC:/src/github/milkyway/web/node_modules/qwik-speak/lib/use-qwik-speak.qwik.mjs
Qwik Speak warn Locale not resolved. Fallback to default locale: en
[QWIK PLUGIN: 804] load() Not found C:/src/github/milkyway/web/i18n/en/app.json
[QWIK PLUGIN: 804] load() Not found C:/src/github/milkyway/web/i18n/en/home.json
[QWIK PLUGIN: 804] load() Not found C:/src/github/milkyway/web/i18n/en/listing.json
[QWIK PLUGIN: 804] load() Not found C:/src/github/milkyway/web/i18n/en/product.json
[QWIK PLUGIN: 804] load() Not found C:/src/github/milkyway/web/i18n/en/runtime.json
[QWIK PLUGIN: 804] transform() Not transforming C:/src/github/milkyway/web/i18n/en/product.json
[QWIK PLUGIN: 804] transform() Not transforming C:/src/github/milkyway/web/i18n/en/listing.json
[QWIK PLUGIN: 804] transform() Not transforming C:/src/github/milkyway/web/i18n/en/app.json
[QWIK PLUGIN: 804] transform() Not transforming C:/src/github/milkyway/web/i18n/en/home.json
[QWIK PLUGIN: 804] transform() Not transforming C:/src/github/milkyway/web/i18n/en/runtime.json
15:02:30 [vite] Internal server error: Missing Qwik City Env Data for help visit https://github.com/QwikDev/qwik/issues/6237
at AsyncFunction.QwikCityProvider_component_TxCFOy819ag [as resolved] (C:\src\github\milkyway\web\node_modules\@builder.io\qwik-city\index.qwik.mjs:659:11)
at AsyncFunction.invokeApply (C:\src\github\milkyway\web\dist-dev\tsc-out\packages\qwik\src\core\util\implicit_dollar.js:3665:22)
at AsyncFunction.invoke (C:\src\github\milkyway\web\dist-dev\tsc-out\packages\qwik\src\core\util\implicit_dollar.js:3658:22)
at C:\src\github\milkyway\web\dist-dev\tsc-out\packages\qwik\src\core\util\implicit_dollar.js:7297:21
at maybeThen (C:\src\github\milkyway\web\dist-dev\tsc-out\packages\qwik\src\core\util\implicit_dollar.js:384:54)
at C:\src\github\milkyway\web\dist-dev\tsc-out\packages\qwik\src\core\util\implicit_dollar.js:7289:25
at C:\src\github\milkyway\web\dist-dev\tsc-out\packages\qwik\src\core\util\implicit_dollar.js:1043:25
at safeCall (C:\src\github\milkyway\web\dist-dev\tsc-out\packages\qwik\src\core\util\implicit_dollar.js:373:21)
at executeComponent (C:\src\github\milkyway\web\dist-dev\tsc-out\packages\qwik\src\core\util\implicit_dollar.js:1043:10)
at renderSSRComponent (C:\src\github\milkyway\web\dist-dev\tsc-out\packages\qwik\src\core\util\implicit_dollar.js:1405:20)
Qwik Speak warn Locale not resolved. Fallback to default locale: en
15:02:30 [vite] Internal server error: Missing Qwik City Env Data for help visit https://github.com/QwikDev/qwik/issues/6237
at AsyncFunction.QwikCityProvider_component_TxCFOy819ag [as resolved] (C:\src\github\milkyway\web\node_modules\@builder.io\qwik-city\index.qwik.mjs:659:11)
at AsyncFunction.invokeApply (C:\src\github\milkyway\web\dist-dev\tsc-out\packages\qwik\src\core\util\implicit_dollar.js:3665:22)
at AsyncFunction.invoke (C:\src\github\milkyway\web\dist-dev\tsc-out\packages\qwik\src\core\util\implicit_dollar.js:3658:22)
at C:\src\github\milkyway\web\dist-dev\tsc-out\packages\qwik\src\core\util\implicit_dollar.js:7297:21
at maybeThen (C:\src\github\milkyway\web\dist-dev\tsc-out\packages\qwik\src\core\util\implicit_dollar.js:384:54)
at C:\src\github\milkyway\web\dist-dev\tsc-out\packages\qwik\src\core\util\implicit_dollar.js:7289:25
at C:\src\github\milkyway\web\dist-dev\tsc-out\packages\qwik\src\core\util\implicit_dollar.js:1043:25
at safeCall (C:\src\github\milkyway\web\dist-dev\tsc-out\packages\qwik\src\core\util\implicit_dollar.js:373:21)
at executeComponent (C:\src\github\milkyway\web\dist-dev\tsc-out\packages\qwik\src\core\util\implicit_dollar.js:1043:10)
at renderSSRComponent (C:\src\github\milkyway\web\dist-dev\tsc-out\packages\qwik\src\core\util\implicit_dollar.js:1405:20) (x2) |
@wmertens just tested it and it seems like it's fixing the constant error, but when I change something and HMR it goes straight into the following error: And it goes away when I manually refrech... If it helps, it seems like it's failing to load the segment of an event handler QRL of the following code:
|
@nelsonprsousa thank you, looks like it's not handling absolute paths in windows correctly. I'll try to fix. @shairez is this with qwik-ui? |
- fixes nx monorepo path lookup in dev mode - fix vite prefix for css etc - fix qrl segment path encoding for windows in dev mode - only pass parent filename since path is always the same - simplify resolveId path handling - change starter to only add service worker in production - add base url to manifest
Is it possible to use @wmertens fix commit with npm? Or only with pnpm? |
@frankroc2022 the instructions literally use npm :-)
|
Thx. I did it wrong. But what triggered these problems qwik or browser changes? I had these problems also with qwik v.1.5.7 and many other versions I tested. |
@nelsonprsousa I think it's fixed for windows now, can you try? |
actually, |
Just deleted node_modules folder. Got:
Looks like we are getting closer. |
Today 2024-07-08 I run npm i https://pkg.pr.new/@builder.io/qwik@6629. Just I run npm list, it showed: Then I changed in package.json Now npm list shows: I rechecked it. With both commits after run npm run dev I get the error: I get this error for [...catchall] and without [...catchall]. |
|
"error loading dynamically imported module: http://localhost:5173/src/components/ts/global_component_useondocument_1nxsaijurq4.js?_qrl_parent=global.tsx" console: But how I can add my custom component to:
? Info: Firefox, Linux in Oracle VirtualBox for Windows. All up-to-date. |
FYI - Whenever there's a new commit being pushed to a PR, the commit hash here is being updated That means that you can install the latest commit by replacing the number suffix (6629) with the commit hash like this:
|
2788974
to
ed49e88
Compare
without this, the react-dom server is loaded with `require` statements in dev mode
This is a temporary fix, the real fix is to remove the full build during buildStart, and then only rely on `.qwik` in the filename. This avoids overbuilding and allows other vite plugins to transform the code.
This way the generated imports by vite and the generated qrl segments are in the same path in devtools
@nelsonprsousa can you test the latest update? @frankroc2022 can you look into global.tsx, are you importing anything there? |
Just checked the new version. Looks like I can no longer import { qwikCity } from '@builder.io/qwik-city/vite'. Rings any bell? ✘ [ERROR] Missing "./vite" specifier in "@builder.io/qwik" package [plugin externalize-deps]
node_modules/vite/node_modules/esbuild/lib/main.js:1225:27:
1225 │ let result = await callback({
╵ ^
at e (file:///C:/src/github/milkyway/web/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:46568:25)
at n (file:///C:/src/github/milkyway/web/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:46568:627)
at o (file:///C:/src/github/milkyway/web/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:46568:1297)
at resolveExportsOrImports (file:///C:/src/github/milkyway/web/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:47189:18)
at resolveDeepImport (file:///C:/src/github/milkyway/web/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:47212:25)
at tryNodeResolve (file:///C:/src/github/milkyway/web/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:46977:16)
at resolveByViteResolver (file:///C:/src/github/milkyway/web/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:66878:20)
at file:///C:/src/github/milkyway/web/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:66911:28
at requestCallbacks.on-resolve (C:\src\github\milkyway\web\node_modules\vite\node_modules\esbuild\lib\main.js:1225:28)
at handleRequest (C:\src\github\milkyway\web\node_modules\vite\node_modules\esbuild\lib\main.js:647:17)
This error came from the "onResolve" callback registered here:
node_modules/vite/node_modules/esbuild/lib/main.js:1150:20:
1150 │ let promise = setup({
╵ ^
at setup (file:///C:/src/github/milkyway/web/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:66899:18)
at handlePlugins (C:\src\github\milkyway\web\node_modules\vite\node_modules\esbuild\lib\main.js:1150:21)
at buildOrContextImpl (C:\src\github\milkyway\web\node_modules\vite\node_modules\esbuild\lib\main.js:873:5)
at Object.buildOrContext (C:\src\github\milkyway\web\node_modules\vite\node_modules\esbuild\lib\main.js:699:5)
at C:\src\github\milkyway\web\node_modules\vite\node_modules\esbuild\lib\main.js:2023:15
at new Promise (<anonymous>)
at Object.build (C:\src\github\milkyway\web\node_modules\vite\node_modules\esbuild\lib\main.js:2022:25)
at build (C:\src\github\milkyway\web\node_modules\vite\node_modules\esbuild\lib\main.js:1873:51)
at bundleConfigFile (file:///C:/src/github/milkyway/web/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:66854:24)
The plugin "externalize-deps" was triggered by this import
vite.config.ts:5:25:
5 │ import { qwikCity } from '@builder.io/qwik-city/vite';
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
failed to load config from C:\src\github\milkyway\web\vite.config.ts
error when starting dev server:
Error: Build failed with 1 error:
node_modules/vite/node_modules/esbuild/lib/main.js:1225:27: ERROR: [plugin: externalize-deps] Missing "./vite" specifier in "@builder.io/qwik" package
at failureErrorWithLog (C:\src\github\milkyway\web\node_modules\vite\node_modules\esbuild\lib\main.js:1472:15)
at C:\src\github\milkyway\web\node_modules\vite\node_modules\esbuild\lib\main.js:945:25
at runOnEndCallbacks (C:\src\github\milkyway\web\node_modules\vite\node_modules\esbuild\lib\main.js:1315:45)
at buildResponseToResult (C:\src\github\milkyway\web\node_modules\vite\node_modules\esbuild\lib\main.js:943:7)
at C:\src\github\milkyway\web\node_modules\vite\node_modules\esbuild\lib\main.js:970:16
at responseCallbacks.<computed> (C:\src\github\milkyway\web\node_modules\vite\node_modules\esbuild\lib\main.js:622:9)
at handleIncomingPacket (C:\src\github\milkyway\web\node_modules\vite\node_modules\esbuild\lib\main.js:677:12)
at Socket.readFromStdout (C:\src\github\milkyway\web\node_modules\vite\node_modules\esbuild\lib\main.js:600:7)
at Socket.emit (node:events:519:28)
at addChunk (node:internal/streams/readable:559:12) |
@nelsonprsousa that's utterly bizarre. Can you check the package.json, and/or recreate node_modules to be sure? |
I've also been having this problem non-stop the last few days but updated my package.json to use the latest commit from this PR:
seems to have fully resolved it! Thanks a bunch! re: |
yarn cache killed me again. Sorry @wmertens, it is working now as expected 🚀 |
I have still the same problem even with 1.7.0. global.tsx
Error in Firefox 127.0.2 (64-bit) Linux in Oracle VM VirtualBox for Windows 11: The error comes only after npm run dev, after refresh page the error is gone. The error only exist for useOnDocument with DOMContentLoaded but not for useOnDocument scroll. Here my package.json:
I also use nearly every time: It doesn't matter if I disable cache or not in developer console under network. What is better disable cache or not? I also tried with closed developer console. Btw. I love qwik since I use it. Edit:
import in root.tsx is now: And I get the same error. Interesting if I have Chrome next to Firefox open the error is only shown in Chrome not in Firefox anymore. If I close the Chrome Tab and restart npm run dev it is again in Firefox shown. So the error exists really only on first load. |
This was my mistake. I never downgraded to 1.5.7 or older because of my mistake in package.json, I had: Error since then: In 1.6.0 when site auto refreshes. In 1.7.0 only when site is loaded for the first time. |
1.7.1 solved all my problems, thx! |
1.7.1 works |