Replies: 3 comments
-
So I think this has something specifically to do with the // src/routes/video/+page.server.js
// use edge runtime, instead of node
export const config = {
runtime: 'edge'
};
// server render on-demand, instead of on-deploy
// export const prerender = false; // <= enabling this would cause errors if enabled with or without the ssr option...
// pre-render only the application shell
export const ssr = false; |
Beta Was this translation helpful? Give feedback.
-
So, if I remove the
This begs the question, why when It seems to me the minification should be skipped and not cause errors when |
Beta Was this translation helpful? Give feedback.
-
I have added a reduced case reproduction of the issue here: https://github.com/leoj3n/repro-sveltekit-transformPageChunk-prerender-false Notable file lines: Clone the repo and run |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to understand how
vercel-adapter
or perhaps just SvelteKit itself treats a route withpage.server
differently based on if thatpage.server
specifiesexport const config = { runtime: 'edge' };
becauseedge
causes thehandle
in myhooks.server
to error on not being able to require node-specific modules.My intuition was that in the
handle
hook I could detect this route that is set to useedge
, and bypass the hook for that route, but this does not seem to solve it. So, it would seem that some kind of artifact is being built regardless of if I try and bypass and then whenadapter-vercel
hits whatever was built it fails ifconfig
is set toedge
for the route in question saying it cannot use node modules likehttp
,path
andurl
.Here is the code for
page.server
andhooks.server
:Here is the output of
npm run build
:You will see that no
CHUNKING ROUTE ID ...
happens for/video
andRESOLVE ROUTE ID /video
happens after✓ built in 11.56s
.Hopefully someone can squint at this and tell me why I can't seem to make it so the
/video
page will work withedge
while also having a server hook that doestransformPageChunk
.Beta Was this translation helpful? Give feedback.
All reactions