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

kit.paths.base can't load css and js with @sveltejs/adapter-cloudflare in production #10290

Closed
chientrm opened this issue Jun 30, 2023 · 3 comments · Fixed by #10604
Closed
Labels
bug Something isn't working pkg:adapter-cloudflare

Comments

@chientrm
Copy link
Contributor

chientrm commented Jun 30, 2023

Describe the bug

Rumor has it kit.paths.base only works when using adapter-static.
I can get the app on but there is no css or js loaded.
I already prefix all URLs in my app with base from $app/paths.

Reproduction

The repo is here: chientrm/sk-base-cf-bug
Production page: https://sk-base-cf-bug.pages.dev/sk-base-cf-bug/

Work fine in local dev but on production it's not.

The title Home and Foo are supposed to be green (with css).
The link Foo and Back are supposed to be hydrated with SvelteKit instead of vanilla .
Here is the build configuration:
250077475-462fd425-89be-4895-88f8-65cdb78474d8

Logs

No response

System Info

System:
    OS: Linux 6.2 Ubuntu 23.04 23.04 (Lunar Lobster)
    CPU: (4) x64 Intel(R) Core(TM) i3-4010U CPU @ 1.70GHz
    Memory: 1.71 GB / 3.50 GB
    Container: Yes
    Shell: 5.2.15 - /bin/bash
  Binaries:
    Node: 18.15.0 - ~/.nvm/versions/node/v18.15.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v18.15.0/bin/yarn
    npm: 9.5.0 - ~/.nvm/versions/node/v18.15.0/bin/npm
    pnpm: 8.4.0 - ~/.nvm/versions/node/v18.15.0/bin/pnpm
  npmPackages:
    @sveltejs/adapter-auto: ^2.0.0 => 2.1.0 
    @sveltejs/adapter-cloudflare: ^2.3.0 => 2.3.0 
    @sveltejs/kit: ^1.20.4 => 1.20.5 
    svelte: ^4.0.0 => 4.0.0 
    vite: ^4.3.6 => 4.3.9

Severity

blocking all usage of SvelteKit

Additional Information

Me and many of my homies want to use 1 domain to rule all the SvelteKit apps under subfolder but this bug is a no no 😢

@Conduitry
Copy link
Member

As requested in the bug report template:

Reproductions must be short, self-contained and correct and must not contain files or code that aren't relevant to the issue — please do NOT just paste a link to your project.

@chientrm
Copy link
Contributor Author

As requested in the bug report template:

Reproductions must be short, self-contained and correct and must not contain files or code that aren't relevant to the issue — please do NOT just paste a link to your project.

I updated the reproduction.

@chientrm
Copy link
Contributor Author

As requested in the bug report template:

Reproductions must be short, self-contained and correct and must not contain files or code that aren't relevant to the issue — please do NOT just paste a link to your project.

Sorry for the lack of information on reproductions. Here is the details:

  • The title Home and Foo are supposed to be green (with css).
  • The link Foo and Back are supposed to be hydrated with SvelteKit instead of vanilla <a href>.

Here is the build configuration:

Screen Shot 2023-06-30 at 6 30 48 PM

Here is the assets uploaded to Cloudflare Pages after build:

Screen Shot 2023-06-30 at 6 31 48 PM

@eltigerchino eltigerchino added the bug Something isn't working label Aug 23, 2023
dummdidumm pushed a commit that referenced this issue Aug 23, 2023
…cloudflare` (#10604)

fixes #10290

Correctly includes the base path config setting when resolving the path to the _app directory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg:adapter-cloudflare
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants