-
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
[✅] fixes for all "Error: Missing Qwik City Env Data" #6237
Comments
@PatrickJS, thank you for creating this thread. But I think it's not a good idea to expect developers to memorize the list you presented. The correct way is to give correct messages. Please let me repeat myself:
That's the first line for troubleshooting and debugging. |
yes, this is only temporary until we track down each error and fix them. The error itself is triggered more often by other errors (which we need to correctly capture) |
happens all the time in firefox... if you open up devtools automatically does that |
there was alot of errors before in dev mode that dont pop up anymore... they still do in the console but before there was an error about some image thing that the dev tools injects some container ( it would mess up my css all the time) maybe whatever was done to mute that started throwing this errors ?
|
What's the reproduction? Is it just new qwik app 1.5.5 and open dev mode in Firefox |
well i just got 1.5.5 and it does the same thing but 15.4 did it do |
@JerryWu1234 do you have time to look into this bug? |
Ok I can do |
|
It happens to me when I use a context provider in the main layout |
I just saw another instance of this error triggered when using a hook that returned a single property from a context-bound Store: export const useFoo = () => {
const store = useContext(MyContext);
return store.foo;
}; The issue was resolved by abandoning the hook and instead retrieving and destructuring the complete store within components: const { foo } = useContext(MyContext); |
I just got it in a new app with
And if i hit a 404 route, i.e posting via postman to a random endpoint - i dont get a 404 and instead i get this error. |
Qwik version 1.6 is causing this error to appear constantly in my application. |
@devcaeg in dev mode or production? Could you make a repro? |
After upgrading to 1.6 seems I can not also get rid off this. Dev mode. I have to re-run "npm start" on every change. |
It happens to me in development mode and it is constantly. For the moment I will go back to the previous version, since version 1.6 makes it impossible for me to work. I will try to make a minimal reproduction of the error so that it can be investigated. |
@gioboa I'm also experiencing it but when I revert the assetsDir commit, I don't experience this any more |
@gioboa I take that back, it's still broken. Not sure why it worked for a bit. |
Went back from 1.6 to 1.5.7. If I have no route [...catchall] I get the same error "Missing Qwik City Env Data for help visit #6237" but If I have a [...catchall] route I get this error "TypeError: error loading dynamically imported module: http://localhost:5173/src/components/ts/global_component_4w7djkoecc8.js%3Ft%3D1719875176718". A fresh 1.6 install has not these problems. |
Can you share with us your repo with the bere minimum stuffs? I would like to face this error because it is so annoying |
I'm encountering it when hot reloading. First render, everything is fine, but change some code, and Vite re-runs entry.ssr without providing a request and then the qwik city server data is missing. Probably the fix is to have module.hot.accept in the right places |
@wmertens is there a quick fix i can do now? what do u mean module.hot.accept in the right places? i'm having this issue persistently. i need to CTRL+C my npm start and restart it again instead of having hot reload |
In the meantime use version 1.5.7 instead of 1.6. |
I just had the same creating my first Qwik App (1.6). I tried it twice, once with the proposed Default Starter and once with the Empty Starter. The default starter opened, but there was no interactivity, neither on the very first button, nor on the counter below. However the Alt+Click seemed to work. I tried again with the empty starter and adding a dummy counter by myself, for some interaction. In both cases I got a js error in the console in the following format:
Not sure if it's correct to trying to access my file system instead of http://localhost. I was using Firefox Developer Edition, also tried in Google Chrome with no success. I tried then to use Qwik 1.5.7 instead of 1.6, and the env error didn't appear again, howevery the error above (URL constructor) still appears in the console and there's no interactivity. Using Windows 11, Node v20.14.0, Npm 10.4.0, killing the process and running Maybe those are related, thought I'd let you know. |
I think I may have a fix for the situation I explained above, here #6629 (comment) It makes sure that the vite dev server recognizes qrl segment requests better and doesn't try to SSR them. @boris-schwarz please try with the npm packages I linked |
@wmertens, @gioboa, @PatrickJS , is there a way to show the stack related to the code of us in error? As I stated above in this thread, the main problem is the lack of information. We don't know why how and where. We have to get into heuristics (trial and error) and restart the app, reboot the system, delete, re-clone, and whatnot. If you can give us more info on the stack, that would help solve lots of problems. |
@wmertens, @gioboa, @PatrickJS, based on the stack:
I see that the method
|
And when I get that error, I get this error to in my console:
And in that file, I have this code:
When I delete this code snippet, then the error goes away. |
Also when looking at network panel I noticed this error "NS_ERROR_CORRUPTED_CONTENT" for this request
|
@7ojo that's 1.6.0, we already know that's broken. Please test #6629 (comment) |
FYI the 1.6.0 errors are fixed in 1.7.0. This doesn't fix all cases because the message applies to many different errors. |
Hey, sorry for the late reply. My case has indeed been fixed with 1.7.0, thanks a lot. |
Now version 1.7 has another error that forces to roll back to version 1.5.7. Error: TypeError: Failed to fetch dynamically imported module: |
This bug exists since version 1.6, but the other bug in version 1.6 used to appear before this bug. But now in version 1.7, this error appears constantly. |
I responded here #6629. |
Facing the same issue. Check the last commit on this branch https://github.com/upayanmazumder/Pterodactyl-Management-Dashboard/tree/Missing-env-data-issue |
btw the deployment on cf for this branch wont work as it isnt configured to work that way. try to run it locally. my api server is at |
1.7.1 solved all my problems, thx! |
@upayanmazumder please minimally reproduce the error with 1.7.1 |
One more reason this "Error: Missing Qwik City Env Data" appears (took me hours to figure out..): The same happens on v1.7.1 - reproduced below: To fix the error - uncomment the "text(200, 'hello');" line in the onGet endpoint inside routes/api/email-list/index.tsx. I had no idea what the reason was - until i read somewhere that having an invalid image URL would cause this. |
@wmertens can you please add the relevant fix context you have? Thanks |
This seems to be related to requesting a bad request in some sort or another. For example using <script
type="speculationrules"
dangerouslySetInnerHTML={`{"prefetch":[{"urls":["/about/index.html"]}]}`}
/> will lead to this error. while <script
type="speculationrules"
dangerouslySetInnerHTML={`{"prefetch":[{"urls":["/about/"]}]}`}
/> won't. |
The most common reason is that SSR is called on a URL that shouldn't be SSR'd. The SSR handler in qwik city should check the context before rendering |
the error seems to appear when you delete the main index.tsx in the "routes" folder |
I added a commit to this draft PR that may expose the problem earlier in dev: |
I am able to get this bug by opening multiple tabs in chrome and then opening devtools. MRE:
duplicate the localhost tab three times and then open the devtools on the third tab |
This happens only when I specify a |
(If you never seen this error then ignore this)
This is a live thread for different ways to fix
Error: Missing Qwik City Env Data
which can be caused by many different errors.Your error might be one of the many fixes listed below
1. cookie issue
clear cookies and site data
2. accidentally importing server-only packages on the client
move server-only code into routeLoader$ or server$
3. deps in "dependencies" not in "devDependencies"
move app dependencies in package.json into "devDependencies"
4. when resizing window on local dev
restart the dev server (comment here and ping me if this doesn't work)
5. partytown install
remove
<QwikPartytown forward={['dataLayer.push', 'fbq']} />
inroot.tsx
The text was updated successfully, but these errors were encountered: