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

Warning: The getStaticPaths() statement has been ignored because output: "server" is set. #7869

Closed
1 task
zepang opened this issue Jul 30, 2023 · 0 comments · Fixed by #7876
Closed
1 task
Labels
- P3: minor bug An edge case that only affects very specific usage (priority)

Comments

@zepang
Copy link

zepang commented Jul 30, 2023

What version of astro are you using?

2.9.6

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

@astrojs/node

What package manager are you using?

pnpm

What operating system are you using?

Mac

What browser are you using?

Chrome

Describe the Bug

I added a Markdown formatted page in the src
directory and executing npm run build in server-side rendering mode I get the following warning message:

[getStaticPaths] The getStaticPaths() statement in
src/pages/Creating a blog using Next.js SSG.md has been ignored because `output: "server"` is set.

I found that it is caused by the logic judgment of vite-plugin-scanner under astro(the version of astro is 2.9.6), and the file path is astro/dist/vite-plugin-scanner/index.js, where there is a judgment of :! pageOptions.prerender && isServerLikeOutput(settings.config) && code.includes("getStaticPaths")
it so happens that my post mentions the getStaticPaths method in next.js. which, in astro server-side rendering mode, gave me the warning message mentioned above

What's the expected result?

I hope the code will be more accurate in determining the inclusion of "getStaticPaths" and won't issue a similar warning!

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-gsrh1x?file=astro.config.mjs&on=stackblitz

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Jul 30, 2023
@bluwy bluwy added the - P3: minor bug An edge case that only affects very specific usage (priority) label Jul 31, 2023
@github-actions github-actions bot removed the needs triage Issue needs to be triaged label Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants