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

Node standalone adapter doesn't match routes without trailing slash when base is set #6371

Closed
1 task
sasoria opened this issue Feb 25, 2023 · 3 comments
Closed
1 task

Comments

@sasoria
Copy link
Contributor

sasoria commented Feb 25, 2023

What version of astro are you using?

2.0.15

Are you using an SSR adapter? If so, which one?

Node

What package manager are you using?

npm

What operating system are you using?

Mac

Describe the Bug

Somewhat similar to #6335, when running the Node adapter in standalone mode and a base path is set, going to the url of the application without a trailing slash returns 404. This is my Astro config:

export default defineConfig({
  base: "/base-path",
  trailingSlash: "ignore",
  integrations: [react()],
  output: "server",
  adapter: node({
    mode: "standalone",
  }),
});

The only working version of the app both in dev and preview is with a trailing slash, even when trailingSlash is set to ignore. That is, http://localhost:3000/basepath returns 404 and http://localhost:3000/basepath/ does not.

Link to Minimal Reproducible Example

https://github.com/sasoria/astro-trailing-slash-exmaple

Participation

  • I am willing to submit a pull request for this issue.
@sasoria
Copy link
Contributor Author

sasoria commented Feb 25, 2023

It looks like a trailing slash is added during build under const _manifest in dist/server/entry.mjs: ... "_meta":{"trailingSlash":"ignore"}}}],"base":"/base-path/

@teinett
Copy link

teinett commented Mar 17, 2023

Related: #4352

@matthewp
Copy link
Contributor

Yes, this is now fixed by #4352

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