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

Static adapter build yields 404 error when setting 'config.kit.paths.base' #2310

Closed
jawshoeadan opened this issue Aug 28, 2021 · 1 comment
Closed

Comments

@jawshoeadan
Copy link

Describe the bug

I have a simple SvelteKit project that is hosted on GitHub Pages, so I have to set the base path to the repository name. I did so in svelte.config.js. Then, I built the project with npm run build. The project yields this error (full log below): > 404 /_app/start-6109155a.js (linked from /)

Reproduction

This is the repository that I'm building my project in. As you can see, I have a GitHub Actions workflow that deploys the website to GitHub Pages statically. Because of the error that is yielded, I just bypass it using || true after the build command. The website fully works after deployed so I'm wondering if there is something I'm doing wrong in my repo or if the error is not supposed to be thrown.

https://github.com/jawshoeadan/simple-svelte-covid-tracker/

To reproduce:

  1. $ git clone https://github.com/jawshoeadan/simple-svelte-covid-tracker.git
  2. $ npm install
  3. $ npm run build

Thank you in advance to anyone who can help.

Logs

jawshoeadan@jawshoedanPC:~/simple-svelte-covid-tracker$ npm run build

> [email protected] build
> svelte-kit build

vite v2.5.1 building for production...
✓ 17 modules transformed.
.svelte-kit/output/client/_app/manifest.json                       1.17 KiB
.svelte-kit/output/client/_app/pages/__layout.svelte-bb9463c2.js   0.64 KiB / brotli: 0.38 KiB
.svelte-kit/output/client/_app/pages/index.svelte-5706a3b8.js      3.20 KiB / brotli: 1.04 KiB
.svelte-kit/output/client/_app/assets/start-61d1577b.css           0.16 KiB / brotli: 0.11 KiB
.svelte-kit/output/client/_app/error.svelte-7695d836.js            1.56 KiB / brotli: 0.64 KiB
.svelte-kit/output/client/_app/start-6109155a.js                   17.57 KiB / brotli: 5.61 KiB
.svelte-kit/output/client/_app/chunks/vendor-4f8f3e75.js           26.18 KiB / brotli: 8.56 KiB
vite v2.5.1 building SSR bundle for production...
transforming (10) node_modules/svelte/ssr.mjs"parse" is imported from external module "papaparse" but never used in "src/routes/index.svelte".
✓ 11 modules transformed.
.svelte-kit/output/server/app.js   14.18 KiB

Run npm run preview to preview your production build locally.

> Using @sveltejs/adapter-static
> 404 /_app/start-6109155a.js (linked from /)
Error: 404 /_app/start-6109155a.js (linked from /)
    at file:///home/jawshoeadan/simple-svelte-covid-tracker/node_modules/@sveltejs/kit/dist/chunks/index5.js:85:11
    at visit (file:///home/jawshoeadan/simple-svelte-covid-tracker/node_modules/@sveltejs/kit/dist/chunks/index5.js:212:5)
    at async visit (file:///home/jawshoeadan/simple-svelte-covid-tracker/node_modules/@sveltejs/kit/dist/chunks/index5.js:280:6)
    at async prerender (file:///home/jawshoeadan/simple-svelte-covid-tracker/node_modules/@sveltejs/kit/dist/chunks/index5.js:290:6)
    at async Object.prerender (file:///home/jawshoeadan/simple-svelte-covid-tracker/node_modules/@sveltejs/kit/dist/chunks/index5.js:351:4)
    at async adapt (file:///home/jawshoeadan/simple-svelte-covid-tracker/node_modules/@sveltejs/adapter-static/index.js:13:4)
    at async adapt (file:///home/jawshoeadan/simple-svelte-covid-tracker/node_modules/@sveltejs/kit/dist/chunks/index5.js:376:2)
    at async file:///home/jawshoeadan/simple-svelte-covid-tracker/node_modules/@sveltejs/kit/dist/cli.js:1012:5

System Info

Using WSL currently but was facing the same issue on macOS.
System:
    OS: Linux 5.10 Debian GNU/Linux 10 (buster) 10 (buster)
    CPU: (4) x64 Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz
    Memory: 2.46 GB / 6.16 GB
    Container: Yes
    Shell: 5.0.3 - /bin/bash
  Binaries:
    Node: 16.8.0 - ~/.nvm/versions/node/v16.8.0/bin/node
    npm: 7.21.0 - ~/.nvm/versions/node/v16.8.0/bin/npm
  npmPackages:
    @sveltejs/adapter-static: ^1.0.0-next.17 => 1.0.0-next.17 
    @sveltejs/kit: next => 1.0.0-next.158 
    svelte: ^3.34.0 => 3.42.3

Severity

serious, but I can work around it

Additional Information

No response

@benmccann
Copy link
Member

Sounds like a duplicate of #2230

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