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

adapter-static will fail to build when used with paths.base. #2421

Closed
ota-meshi opened this issue Sep 14, 2021 · 3 comments
Closed

adapter-static will fail to build when used with paths.base. #2421

ota-meshi opened this issue Sep 14, 2021 · 3 comments

Comments

@ota-meshi
Copy link
Member

ota-meshi commented Sep 14, 2021

Describe the bug

@sveltejs/adapter-static will fail to build when used with paths.base.

svelte.config.js I'm using is:

import staticAdapter from '@sveltejs/adapter-static';
/** @type {import('@sveltejs/kit').Config} */
const config = {
	kit: {
		paths: {
			base: '/foo'
		},
		// hydrate the <div id="svelte"> element in src/app.html
		target: '#svelte',

		adapter: staticAdapter({
			// default options are shown
			pages: 'build',
			assets: 'build',
			fallback: null
		}),
	}
};

export default config;

Reproduction

https://github.com/ota-meshi/svelte-kit-sandbox-static

Running npm run build will result in an error.
(But running npm run dev works fine.)

Logs

4.07 KiB / brotli: 1.46 KiB
.svelte-kit/output/client/_app/start-9d0d6076.js                                         17.85 KiB / brotli: 5.67 KiB
vite v2.5.7 building SSR bundle for production...
✓ 28 modules transformed.
.svelte-kit/output/server/app.js   86.38 KiB

Run npm run preview to preview your production build locally.

> Using @sveltejs/adapter-static
> 404 /_app/start-9d0d6076.js (linked from /)
Error: 404 /_app/start-9d0d6076.js (linked from /)
    at file:///xxxxxxx/svelte-kit-sandbox-static/node_modules/@sveltejs/kit/dist/chunks/index5.js:85:11
    at visit (file:///xxxxxxx/svelte-kit-sandbox-static/node_modules/@sveltejs/kit/dist/chunks/index5.js:212:5)
    at async visit (file:///xxxxxxx/svelte-kit-sandbox-static/node_modules/@sveltejs/kit/dist/chunks/index5.js:280:6)
    at async prerender (file:///xxxxxxx/svelte-kit-sandbox-static/node_modules/@sveltejs/kit/dist/chunks/index5.js:290:6)
    at async Object.prerender (file:///xxxxxxx/svelte-kit-sandbox-static/node_modules/@sveltejs/kit/dist/chunks/index5.js:351:4)
    at async adapt (file:///xxxxxxx/svelte-kit-sandbox-static/node_modules/@sveltejs/adapter-static/index.js:13:4)
    at async adapt (file:///xxxxxxx/svelte-kit-sandbox-static/node_modules/@sveltejs/kit/dist/chunks/index5.js:376:2)
    at async file:///xxxxxxx/svelte-kit-sandbox-static/node_modules/@sveltejs/kit/dist/cli.js:872:5

System Info

System:
    OS: macOS 10.15.7
    CPU: (4) x64 Intel(R) Core(TM) i5-6360U CPU @ 2.00GHz
    Memory: 545.69 MB / 8.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 14.17.0 - /usr/local/bin/node
    Yarn: 1.22.11 - /usr/local/bin/yarn
    npm: 6.14.13 - /usr/local/bin/npm
  Browsers:
    Chrome: 93.0.4577.82
    Firefox: 79.0
    Safari: 14.1.2

Severity

annoyance

Additional Information

No response

@baseballyama
Copy link
Member

This is same as #2230

@ignatiusmb
Copy link
Member

Duplicate of #2230

Thanks @baseballyama

@ota-meshi
Copy link
Member Author

Thank you for letting me know! That is same.

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

3 participants