-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Cloudflare adapter: Could not resolve "path" and "fs" #2850
Comments
Same problem here! Haven't got much luck on the Discord so far. It would be lovely to have API endpoints working with CF pages since (I believe) the Cloudflare blog post says that it should now work with a Node environment. |
@flayks I'm able to get it to work after removing all node based dependencies. I was using path and fs packages for generating JSON in API, but then I had to move it to a script in prebuild and then consume it in my app. Not possible to have it dynamic via API routes. |
Ah, I found the bug. Since the code is using kit/packages/adapter-cloudflare/index.js Line 42 in f95801e
I can solve this easily, but I think I need to understand why it is set to |
Changing to platform 'node' fixes the building error but still does not deploy to cloudflare. Here is the example, it builds
|
Cloudflare Workers do not run Node. While it looks weird that the |
There's a few things that need to happen here to prevent this sort of thing:
Since we have issues tracking all those things, I'll close this issue |
Describe the bug
For deploying a markdown blog using sveltekit to cloudflare, it is required to read the file system to get the list of files. This fails after adding the cloudflare adapter
Reproduction
Clone Repo: https://github.com/rodneylab/sveltekit-blog-mdx
Run:
npm i --save-dev @sveltejs/adapter-cloudflare@next
Change the adapter in
svelte.config.js
tocloudflare-adapter
Run
npm run build
Logs
System Info
Severity
blocking all usage of SvelteKit
Additional Information
Prevent the deployment of the project. The build in cloudflare deployment environment also fails for the same reason.
The text was updated successfully, but these errors were encountered: