Skip to content

Build warning incorrectly triggered by comment mentioning trailingSlash in +page.svelte #13781

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

Open
ouksal opened this issue May 10, 2025 · 0 comments

Comments

@ouksal
Copy link

ouksal commented May 10, 2025

Describe the bug

I'm trying to use trailingSlash = 'always' in src/routes/+layout.js, as described in the docs:
https://svelte.dev/docs/kit/page-options#trailingslash

However, during npm run build, I get this warning:

src/routes/arrival/+page.svelte
export const trailingSlash will be ignored — move it to +page(.server).js/ts instead.

Reproduction

After some debugging, I discovered that the warning was caused by a comment inside /routes/arrival/+page.svelte that included the word "trailingSlash". Simply removing that comment resolved the issue.

I'm not sure why the build process interprets a comment as an actual export. Possibly a bug in the static analysis?

Logs

System Info

Chrome

Severity

annoyance

Additional Information

No response

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

1 participant