-
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: externalize node:async_hooks for all adapters #5910
Conversation
👷 Deploy request for qwik-insights pending review.Visit the deploys page to approve it
|
Hi! After upgrading to 1.5.0, I'm getting this error building for production (vercel adapter if it's helpful)
feels related. |
Hi all, you need to add node:async_hooks to your externals. I'll add a comment to the release. |
Even after adding that to vite.config.ts, I'm still getting this error when building for production. |
@brandonpittman can you share your configuration? It should be impossible for you to get that error |
import { defineConfig } from "vite";
import { qwikVite } from "@builder.io/qwik/optimizer";
import { qwikCity } from "@builder.io/qwik-city/vite";
import tsconfigPaths from "vite-tsconfig-paths";
import { vanillaExtractPlugin } from "styled-vanilla-extract/vite";
import { qwikTypes } from "@builder.io/qwik-labs/vite";
export default defineConfig(() => {
return {
define: {
// enables debugging in workbox
"process.env.NODE_ENV": JSON.stringify("development"),
},
plugins: [
qwikCity(),
qwikVite(),
tsconfigPaths(),
qwikTypes(),
vanillaExtractPlugin(),
],
preview: {
headers: {
"Cache-Control": "public, max-age=600",
},
},
};
}); Here's my Vite config. Nothing crazy. |
the config you've pasted doesn't include the externals change: export default defineConfig(() => {
return {
ssr: {
external: ["node:async_hooks"],
}, |
Actually I just realized I can define the externals in the qwikVite plugin 🤦. I'm doing that now and will release qwik@dev with this change shortly. |
@brandonpittman can you upgrade to qwik@dev? That should fix the production build without further changes |
Actually it works fine in test projects for me, so I'm deploying 1.5.1. |
Ah, it's having a problem in the Cloudflare adapter's
import { cloudflarePagesAdapter } from "@builder.io/qwik-city/adapters/cloudflare-pages/vite";
import { extendConfig } from "@builder.io/qwik-city/vite";
import baseConfig from "../../vite.config";
// @ts-expect-error
export default extendConfig(baseConfig, () => {
return {
build: {
ssr: true,
rollupOptions: {
input: ["src/entry.cloudflare-pages.tsx", "@qwik-city-plan"],
},
},
ssr: {
external: ['node:async_hooks'],
},
plugins: [cloudflarePagesAdapter()],
};
}); |
I figured out the problem: Vite 4. I started this app before Vite 5 was released and it was working fine up till now. I created a new app and compared the Probably could use a mention in the release notes. |
@brandonpittman so you're using 1.5.1 and iets still broken, and you upgraded to vite 5 and it works? |
1.5.1 with Vite 4 is broken. 1.5.1 with Vite 5 is fine. |
No description provided.