-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Serving static files via hono on bun kills the prerenderer #28910
Comments
Are you using Unfortunately, |
I am importing |
It seems that you're using Bun as a package manager rather than as a runtime, which are two distinct tools. To learn more about installing Bun as a runtime, check out the official documentation here: Bun Installation Guide. |
Hey @alan-agius4 I did install bun and could also execute the built server with it. |
Can you update please update "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const worker_threads_1 = require("worker_threads");
const schema_1 = require("../../builders/application/schema");
const fetch_patch_1 = require("./fetch-patch");
const launch_server_1 = require("./launch-server");
const load_esm_from_memory_1 = require("./load-esm-from-memory");
/**
* This is passed as workerData when setting up the worker via the `piscina` package.
*/
const { outputMode, hasSsrEntry } = worker_threads_1.workerData;
let serverURL = launch_server_1.DEFAULT_URL;
/** Renders an application based on a provided options. */
async function extractRoutes() {
if (outputMode !== undefined && hasSsrEntry) {
serverURL = await (0, launch_server_1.launchServer)();
}
(0, fetch_patch_1.patchFetchToLoadInMemoryAssets)(serverURL);
const { ɵextractRoutesAndCreateRouteTree: extractRoutesAndCreateRouteTree } = await (0, load_esm_from_memory_1.loadEsmModuleFromMemory)('./main.server.mjs');
const { routeTree, appShellRoute, errors } = await extractRoutesAndCreateRouteTree(serverURL, undefined /** manifest */, true /** invokeGetPrerenderParams */, outputMode === schema_1.OutputMode.Server /** includePrerenderFallbackRoutes */);
return {
errors,
appShellRoute,
serializedRouteTree: routeTree.toObject(),
};
}
exports.default = extractRoutes; |
Command
build
Is this a regression?
The previous version in which this bug was not present was
No response
Description
I wanted to use the new hybrid rendering with hono and bun.
Everything seems to work mostly fine until I try to serve static files from my server. This kills my build process as the route extraction fails.
As long as the static serving is commented out, the build is fine and works with bun and the dev server.
Minimal Reproduction
I have a repro here https://github.com/heddendorp/ssr-bun-issue
Cloning, running
bun install
andbun run build
will give you the error.You can get rid of this line https://github.com/heddendorp/ssr-bun-issue/blob/4492a605afff2829b28274c0e09c6ef0ec3c1901/projects/app/src/server.ts#L46 to make the build work.
Exception or Error
Your Environment
Anything else relevant?
I'm happy to provide more context to clear this up
The text was updated successfully, but these errors were encountered: