Open devcaeg opened 11 months ago
I get this errer instead:
Error: `line` must be greater than 0 (lines start at line 1)
at originalPositionFor$1 (/home/projects/qwik-starter-juwwvd/node_modules/vite/dist/node/chunks/dep-3b8eb186.js:10169:19)
at eval (/home/projects/qwik-starter-juwwvd/node_modules/vite/dist/node/chunks/dep-3b8eb186.js:55782:25)
at eval (/home/projects/qwik-starter-juwwvd/node_modules/vite/dist/node/chunks/dep-3b8eb186.js:55773:21)
at ssrRewriteStacktrace (/home/projects/qwik-starter-juwwvd/node_modules/vite/dist/node/chunks/dep-3b8eb186.js:55772:10)
at ssrFixStacktrace (/home/projects/qwik-starter-juwwvd/node_modules/vite/dist/node/chunks/dep-3b8eb186.js:55825:24)
at Object.ssrFixStacktrace (/home/projects/qwik-starter-juwwvd/node_modules/vite/dist/node/chunks/dep-3b8eb186.js:65006:13)
at eval (/home/projects/qwik-starter-juwwvd/node_modules/@builder.io/qwik/optimizer.cjs:2897:18)
Could you help us by bisecting which change is causing the issue.
You can install @builder.io/qwik
from https://github.com/BuilderIO/qwik-build. Edit package.json
"@builder.io/qwik": "github:BuilderIo/qwik-build#SHA",
Where the SHA
is a specific SHA
from https://github.com/BuilderIO/qwik-build In this way you could help us a lot.
Hi @mhevery,
Yes, the error "Error: `line` must be greater than 0 (lines start at line 1)..."
is the one that appears in Stackblitz, which for some reason is different from the one that appears running the project locally.
@mhevery
I've pinpointed the source of the error, and it appears to be an issue that has been present for some time. The problem emerges starting from version "0.19.0" with the message: [vite] Internal server error: Optimizer should replace all usages of $() with some special syntax. If you need to create a QRL manually, use inlinedQrl() instead.
The immediately preceding version, "0.18.1", as well as its predecessors, display a different error but linked to the same code. The associated error messages are:
[vite] Internal server error: Reference to identifier declared at the root 'test$'. It needs to be exported in order to be used inside a Qrl($) scope.
[vite] Internal server error: Found 'test$' but did not find the corresponding 'testQrl' exported in the same file. Please ensure it is exported and spelled correctly.
In summary, from version "0.19.0" onwards, I encounter the same error, whereas in versions prior to "0.19.0", I come across two different errors.
@mhevery
Upon further investigation, I determined that the error [vite] Internal server error: Optimizer should replace all usages of $() with some special syntax. If you need to create a QRL manually, use inlinedQrl() instead.
appears starting from this commit in "qwik-build". For some reason, this commit introduces the issue. In the preceding commit, the aforementioned error doesn't show up, but the other two previously mentioned errors do.
P.S.: I might be completely wrong in my conclusions. However, that's as far as my investigation took me.
WOW, that is a very old commit...
I've updated the issue reproduction on StackBlitz. When running "npm run dev", the error is displayed. However, when using "npm run preview", there is no error, but the code doesn't execute fully, as evidenced by some clear console.log (the god of debugging 🤪) messages.
Any news on this issue?
Which component is affected?
Qwik Optimizer (rust)
Describe the bug
There is an issue with the Qwik optimizer. This problem did not occur in previous versions, though I can't specify from which version it started. When trying to execute a function wrapped in "implicit$FirstArg", the following error message appears: "Optimizer should replace all usages of $() with some special syntax. If you need to create a QRL manually, use inlinedQrl() instead." This error prevents the application from continuing to run.
This error is affecting libraries like ModularForms by the creator @fabian-hiller. Although there's an issue (fabian-hiller/modular-forms#135) opened in the ModularForms repository, the root of the problem lies in Qwik.
Reproduction
https://stackblitz.com/edit/qwik-starter-juwwvd?file=src%2Froutes%2Findex.tsx
Steps to reproduce
System Info
Additional Information
The error in StackBlitz differs slightly from a local execution. In local mode (development mode), the error is displayed in both the console and the browser screen. However, in StackBlitz, the error appears in the console with a different message and prevents the project from starting.