Skip to content
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

Deployment Issues on Cloudflare Pages with SvelteKit 5 #801

Closed
rastislavcore opened this issue Nov 29, 2024 · 2 comments
Closed

Deployment Issues on Cloudflare Pages with SvelteKit 5 #801

rastislavcore opened this issue Nov 29, 2024 · 2 comments

Comments

@rastislavcore
Copy link

We are encountering issues while deploying two separate SvelteKit 5 projects to Cloudflare Pages. The build process fails with errors related to resolving component paths or modules. Here are the details of the issues:

  1. Project 1: DApp SvelteKit Boilerplate
    Error:

    [vite-plugin-pwa:build] Could not resolve "./icon" from "src/lib/components/index.ts"
    

    The index.ts exports components from specific folders, such as export { Icon } from './icon';, but the PWA plugin cannot resolve the path despite no issues in local development.

  2. Project 2: PayTo
    Error:

    Could not resolve "./Toast.svelte" from "src/lib/components/toast/index.ts"
    

    Similar to the first project, the index.ts files structure components, and the issue arises when the PWA plugin fails to resolve paths during the Cloudflare build process.

Both projects work correctly in local environments, including full SSR builds, but they consistently fail on Cloudflare Pages. Key configurations such as vite.config.ts, TypeScript type definitions, and component structures have been verified, and Cloudflare-specific configurations (e.g., wrangler.toml) align with the projects’ requirements.

Questions for the Community:

  1. Are there known limitations or nuances with the vite-plugin-pwa or Rollup on Cloudflare Pages that could be causing these resolution issues?
  2. Could the problem be related to the wrangler.toml setup, Cloudflare's filesystem structure, or case sensitivity in component folder names?
  3. Is there a recommended debugging approach to further isolate issues specific to Cloudflare’s environment?

Any insights or similar experiences would be greatly appreciated!

@userquin
Copy link
Member

can you try removing/disabling the pwa plugin in CF to test the build without the plugin? the buildEnd hook in the pwa build plugin just re-throw the error if present:

@rastislavcore
Copy link
Author

Not related to plugin itself. Analyzing the issue further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants