-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix: Bun integration env.get is undefined #5601
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
Conversation
👷 Deploy request for qwik-insights pending review.Visit the deploys page to approve it
|
Thanks @phyrog 💪 |
Yes I did. |
I tested the current bun integration and it's working fine 🤔 Steps:
This is my import { component$ } from "@builder.io/qwik";
import { routeLoader$ } from "@builder.io/qwik-city";
export const useEnvLoader = routeLoader$(({ env }) => env.get('TEST'))
export default component$(() => {
const envLoader = useEnvLoader();
return (<>{envLoader.value}</>
);
}); |
@gioboa Here's my system specs:
edit: I just rebuilt again, now it shows up. However: when I change the variable after the build, it is not picked up, it will still display the old value; so I guess it gets baked into the code instead of reading at runtime? Just my guess: When setting Edit2: changing the var after building also does not work with my version 😆 But anyway, the original problem was a different one, where .get was not defined on env. I will investigate why it works with |
Ok so I debugged this a bit more: The current version works for Reproducable the same way you posted above, but with this code in import { component$ } from "@builder.io/qwik";
import { Form, routeAction$ } from "@builder.io/qwik-city";
export const useEnv = routeAction$((_data, req) => {
console.log(req.env.get("TEST"))
});
export default component$(() => {
const e = useEnv()
return (
<>
<Form action={e}>
<button type="submit">Env</button>
</Form>
</>
);
}); Will result in an error, same with |
@gioboa I also looked more into why it works for |
Thanks @phyrog for your commitment. Your change is working fine. I have this other error in the terminal but it's not related to your change. |
@gioboa No I don't think I have seen this one |
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@builder.io/qwik](https://qwik.builder.io/) ([source](https://togithub.com/BuilderIO/qwik/tree/HEAD/packages/qwik)) | [`1.3.1` -> `1.3.2`](https://renovatebot.com/diffs/npm/@builder.io%2fqwik/1.3.1/1.3.2) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>BuilderIO/qwik (@​builder.io/qwik)</summary> ### [`v1.3.2`](https://togithub.com/BuilderIO/qwik/releases/tag/v1.3.2) [Compare Source](https://togithub.com/BuilderIO/qwik/compare/v1.3.1...v1.3.2) ##### What's Changed - docs: update portal cookbook with solved problems by [@​thejackshelton](https://togithub.com/thejackshelton) in [https://github.com/BuilderIO/qwik/pull/5600](https://togithub.com/BuilderIO/qwik/pull/5600) - chore: Add notice about service worker usage by [@​nelsonprsousa](https://togithub.com/nelsonprsousa) in [https://github.com/BuilderIO/qwik/pull/5606](https://togithub.com/BuilderIO/qwik/pull/5606) - fix: Bun integration env.get is undefined by [@​phyrog](https://togithub.com/phyrog) in [https://github.com/BuilderIO/qwik/pull/5601](https://togithub.com/BuilderIO/qwik/pull/5601) - fix(insights): form errors by [@​mhevery](https://togithub.com/mhevery) in [https://github.com/BuilderIO/qwik/pull/5607](https://togithub.com/BuilderIO/qwik/pull/5607) - fix(qwik-insights): fix up create application form by [@​iamriajul](https://togithub.com/iamriajul) in [https://github.com/BuilderIO/qwik/pull/5573](https://togithub.com/BuilderIO/qwik/pull/5573) - docs(layout): Add "Slot" import by [@​HenriqueLimas](https://togithub.com/HenriqueLimas) in [https://github.com/BuilderIO/qwik/pull/5612](https://togithub.com/BuilderIO/qwik/pull/5612) - fix(tests): fix typos by [@​maiieul](https://togithub.com/maiieul) in [https://github.com/BuilderIO/qwik/pull/5616](https://togithub.com/BuilderIO/qwik/pull/5616) - fix: Correct qwik types by [@​mhevery](https://togithub.com/mhevery) in [https://github.com/BuilderIO/qwik/pull/5623](https://togithub.com/BuilderIO/qwik/pull/5623) - fix(docs): add missing cookbook section by [@​gioboa](https://togithub.com/gioboa) in [https://github.com/BuilderIO/qwik/pull/5626](https://togithub.com/BuilderIO/qwik/pull/5626) - fix(tailwind starter): switch from cjs to esm to support vite 5 by [@​thejackshelton](https://togithub.com/thejackshelton) in [https://github.com/BuilderIO/qwik/pull/5635](https://togithub.com/BuilderIO/qwik/pull/5635) - docs: fix up markdown rendering by [@​ValentinBossi](https://togithub.com/ValentinBossi) in [https://github.com/BuilderIO/qwik/pull/5532](https://togithub.com/BuilderIO/qwik/pull/5532) - refactor(insights): improve consistency by [@​iamriajul](https://togithub.com/iamriajul) in [https://github.com/BuilderIO/qwik/pull/5609](https://togithub.com/BuilderIO/qwik/pull/5609) - docs: improve getting started steps by [@​shwosner](https://togithub.com/shwosner) in [https://github.com/BuilderIO/qwik/pull/5620](https://togithub.com/BuilderIO/qwik/pull/5620) - docs: improve eslint loader msg + add cookbook example by [@​gioboa](https://togithub.com/gioboa) in [https://github.com/BuilderIO/qwik/pull/5591](https://togithub.com/BuilderIO/qwik/pull/5591) - fix(ssr): slot subscribers by [@​wmertens](https://togithub.com/wmertens) in [https://github.com/BuilderIO/qwik/pull/5608](https://togithub.com/BuilderIO/qwik/pull/5608) - docs: create NavLink cookbook example by [@​Adbib](https://togithub.com/Adbib) in [https://github.com/BuilderIO/qwik/pull/5621](https://togithub.com/BuilderIO/qwik/pull/5621) - fix(tailwind): fix prettier config type by [@​shairez](https://togithub.com/shairez) in [https://github.com/BuilderIO/qwik/pull/5641](https://togithub.com/BuilderIO/qwik/pull/5641) - docs: add Node Docker deploy example by [@​nelsonprsousa](https://togithub.com/nelsonprsousa) in [https://github.com/BuilderIO/qwik/pull/5605](https://togithub.com/BuilderIO/qwik/pull/5605) - docs(cookbook): font optimization guide by [@​thejackshelton](https://togithub.com/thejackshelton) in [https://github.com/BuilderIO/qwik/pull/5645](https://togithub.com/BuilderIO/qwik/pull/5645) - fix: rendering ssr and csr for value="" by [@​wmertens](https://togithub.com/wmertens) in [https://github.com/BuilderIO/qwik/pull/5642](https://togithub.com/BuilderIO/qwik/pull/5642) - fix: remove unnecessary whitespace when handling classes by [@​jakovljevic-mladen](https://togithub.com/jakovljevic-mladen) in [https://github.com/BuilderIO/qwik/pull/5648](https://togithub.com/BuilderIO/qwik/pull/5648) - fix(jsx): dynamic DOM element props by [@​wmertens](https://togithub.com/wmertens) in [https://github.com/BuilderIO/qwik/pull/5650](https://togithub.com/BuilderIO/qwik/pull/5650) - refactor(jsx): tiny improvement by [@​wmertens](https://togithub.com/wmertens) in [https://github.com/BuilderIO/qwik/pull/5654](https://togithub.com/BuilderIO/qwik/pull/5654) - feat: add `skipConfirmation` to cli add command by [@​shairez](https://togithub.com/shairez) in [https://github.com/BuilderIO/qwik/pull/5655](https://togithub.com/BuilderIO/qwik/pull/5655) - chore: 1.3.2 by [@​shairez](https://togithub.com/shairez) in [https://github.com/BuilderIO/qwik/pull/5661](https://togithub.com/BuilderIO/qwik/pull/5661) ##### New Contributors - [@​phyrog](https://togithub.com/phyrog) made their first contribution in [https://github.com/BuilderIO/qwik/pull/5601](https://togithub.com/BuilderIO/qwik/pull/5601) - [@​HenriqueLimas](https://togithub.com/HenriqueLimas) made their first contribution in [https://github.com/BuilderIO/qwik/pull/5612](https://togithub.com/BuilderIO/qwik/pull/5612) - [@​ValentinBossi](https://togithub.com/ValentinBossi) made their first contribution in [https://github.com/BuilderIO/qwik/pull/5532](https://togithub.com/BuilderIO/qwik/pull/5532) - [@​shwosner](https://togithub.com/shwosner) made their first contribution in [https://github.com/BuilderIO/qwik/pull/5620](https://togithub.com/BuilderIO/qwik/pull/5620) **Full Changelog**: QwikDev/qwik@v1.3.1...v1.3.2 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 9pm on sunday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/ascorbic/unpic-img). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xMjEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjEyMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
Overview
What is it?
Description
Fixes this error when using
req.env
with Bun (e.g. for qwik-auth):Checklist: