Pages "Worker threw exception Error 1101"
Hi guys,
I have semi-successfully deployed my SvelteKit application to Cloudflare Pages (connected via GitHub repository).
It tells me in the logs that the build was successful, however when I go to the URL it tells me it's not working! D: (see attached)
Any ideas how I can go about debugging/fixing this?
Below is parts of the build log I thought could be relevant:
![No description](https://cdn.answeroverflow.com/1227015776561791036/image.png)
5 Replies
Sorry I'm not familiar with doing that. What is that and how could I do it? Is there any documentation I could read?
Hey I think I found a way to view logs through the functions "real time logs", I now have something to look at:
I have tried installing the
process
NPM package but still have the same error
I assume the clerk-sdk-node
package uses process
somewhere? And Cloudflare Pages does not hhave that. Am I right in understanding process
is typically a default thing in Node, but Pages runs its "own modified version" of Node? Or at least is that the gist of it?Page Functions are just Cloudflare Workers with some sugar/magic around them, and
Workers aren't node at all. They use the v8 Javascript Engine -- same as Chrome: https://developers.cloudflare.com/workers/reference/how-workers-works/
You have a "web like environment". There is some nodejs compatability you can enable, but it's mostly just re-implementing some node functions, still not going to have process or any file system.
Thanks for clarifying my misunderstanding <3
What route would you suggest I take to resolving the lack of
process
?
Thanks, that's useful I now know it can exist! Though with Pages, I don't have a wrangler.toml file so I am unsure where I could put the flag mentioned? I'll do some Googling tooIn your pages project -> Settings -> Functions -> Configure Production compatibility flags -> nodejs_compat
it'd only work if the package is importing from node:process and not process, and like I said above you're not going to the actual process, can't have child processes, etc
Yeah I'm not sure what the Clerk packages use exactly, I assume they're using process for env variables... I'm pretty stumped on what to do haha