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-node can't find build assets when paths.base is set to non-empty string #6173

Closed
DrDanRyan opened this issue Aug 22, 2022 · 2 comments

Comments

@DrDanRyan
Copy link

Describe the bug

Using a non-empty string value for paths.base in svelte.config.js with adapter-node will result in a site where all .js and .css files requests return 404.

There is a warning message in npm run build that says:
(!) "base" option should end with a slash.

However, if you try to put a value that ends in slash then an error is thrown that paths.base cannot end in a slash.

Reproduction

  1. start a skeleton app
  2. replace adapter-auto with adapter-node
  3. set a value for paths.base in svelte.config.js like "/foo"
  4. npm run build
  5. node build/index.js
  6. navigate to the app with devtools open and observe that the asset chunks are 404

Logs

Example request for an app with `paths.base == "/foo"`
GET
	
scheme
	http
host
	127.0.0.1:3000
filename
	/foo/_app/immutable/start-e87edd60.js
Address
	127.0.0.1:3000
Status
404
Not Found
Version HTTP/1.1
Transferred 592 B (0 B size)
Referrer Policy strict-origin-when-cross-origin

System Info

"node_modules/@sveltejs/adapter-node": {
			"version": "1.0.0-next.86",

"node_modules/@sveltejs/kit": {
			"version": "1.0.0-next.428",

Severity

blocking all usage of SvelteKit

Additional Information

I can't use Svelte kit for my project at this point because it must be served at a non-root endpoint.

@babichjacob
Copy link
Member

Is #3726 the same as your issue?

@DrDanRyan
Copy link
Author

Yes, it is, didn't find that issue in my first search. Closing this one.

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