Replies: 1 comment 2 replies
-
I had unlucky experience with Payload local API. After a lot of days of struggles, I just switched to REST. Too many problems with this feature. Next.js is the one to blame, for sure. Everything was working ok on local setup, but any serverless experience with Payload x [any non-next-js] was a total mess |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to use the local API via the
getPayload
function in SvelteKit and I have encountered a problem with a CPU hog.Minimal reproduction here: https://github.com/grunghi/payloadkit
I am initializing payload inside
hooks.server.ts
and when i callawait getPayload({ config })
it hogs the cpu thread to 100% indefinetly, however the queries in data loaders work fine.It does the same thing when I
getPayload
directly in the server load function.It happens both in dev and on the staging server.
I tried to do profiling with
node --inspect
, but that just shows that it is mostly idle.I use the latest version of payload - 3.20.0 with postgres and node 23.
Tried it on node 22 and also 3.16.0 with the same results.
Does anybody have some experience with running payload outside of next, specifically with SvelteKit / Vite?
I suppose this issue might be due to the fact that Sveltekit bundles payload with vite.
This is my
hooks.server.ts
in sveltekit:Beta Was this translation helpful? Give feedback.
All reactions