-
-
Notifications
You must be signed in to change notification settings - Fork 386
Open
Labels
Description
Description
I create a handler, in this handler I'm using 'prerender', and after I get this error:
vite v7.3.1 building ssr environment for production...
"@babel/preset-typescript/package.json" is imported by "@babel/preset-typescript/package.json?commonjs-external", but could not be resolved – treating it as an external dependency.
...
...
...
11:27:53 [[email protected]][Bug] You stumbled upon a Vike bug. Go to https://github.com/vikejs/vike/issues/new?template=bug.yml and copy-paste this error. A maintainer will fix the bug (usually within 24 hours).
at find_ASSETS_MANIFEST (file:///home/projects/zblbj6ud/node_modules/.pnpm/[email protected][email protected]/node_modules/vike/dist/node/vite/plugins/build/pluginProdBuildEntry.js:106:30)
at Module.set_macro_ASSETS_MANIFEST (file:///home/projects/zblbj6ud/node_modules/.pnpm/[email protected][email protected]/node_modules/vike/dist/node/vite/plugins/build/pluginProdBuildEntry.js:83:23)
at Module.handleAssetsManifest (file:///home/projects/zblbj6ud/node_modules/.pnpm/[email protected][email protected]/node_modules/vike/dist/node/vite/plugins/build/handleAssetsManifest.js:347:53)
at Object.handler (file:///home/projects/zblbj6ud/node_modules/.pnpm/[email protected][email protected]/node_modules/vike/dist/node/vite/plugins/build/pluginBuildApp.js:111:25)
ELIFECYCLE Command failed with exit code 1.
Reproduction
import { apply, serve } from '@photonjs/hono';
import { enhance, UniversalHandler } from '@universal-middleware/core';
import { Hono } from 'hono';
import { prerender } from 'vike/api';
export const createRevalidateHandler: UniversalHandler<
Universal.Context & object
> = enhance(
async (_request, _context, _runtime) => {
await prerender(); // Add or remove to reproduce
return Response.json(
{
revalidate: true,
date: String(new Date()),
},
{
status: 200,
headers: {
'content-type': 'application/json',
},
}
);
},
{
name: 'revalidate-handler',
path: '/api/revalidate',
method: ['GET', 'POST'],
immutable: false,
}
);
const port = process.env.PORT ? parseInt(process.env.PORT, 10) : 3000;
export default startApp() as unknown;
function startApp() {
const app = new Hono();
apply(app, [createRevalidateHandler]);
return serve(app, {
port,
});
}
Reactions are currently unavailable