@sveltejs/adapter-cloudflare problem in a monorepo
I have a local workspace package that I import into my sveltekit project. Lets say this package has kysely and @libsql/kysely as its dependencies. Consuming this package results in a build failure like this:
Now if I pnpm install the dependencies of the workspace package directly to the sveltekit project, so in this case kysely and @libsql/kysely, the build is successful. This means that whenever sveltekit consumes a package, I would need to make sure that sveltekit has its dependencies explicitly installed as well.
I have confirmed this with a package that uses @aws-sdk as well. Build fails when @aws-sdk is not directly installed to sveltekit, works when it is installed.
2 Replies
You can try this adapter: https://www.npmjs.com/package/@chientrm/adapter-cloudflare
npm
@chientrm/adapter-cloudflare
Adapter for building SvelteKit applications on Cloudflare Pages with Workers integration. Latest version: 2.3.4, last published: 12 days ago. Start using @chientrm/adapter-cloudflare in your project by running
npm i @chientrm/adapter-cloudflare
. There are no other projects in the npm registry using @chientrm/adapter-cloudflare.in
svelte.config.js
, change adapter line to this: