Skip to content

entries export only accepts one export per route, but doesn't warn about this behavior #9995

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
elliott-with-the-longest-name-on-github opened this issue May 20, 2023 · 0 comments
Assignees

Comments

@elliott-with-the-longest-name-on-github
Copy link
Contributor

Describe the bug

If I export entries from +page, +page.server, and +server in the same route, only one of them will be run and used to generate the prerender entries. We should:

  • Throw an error when more than one entries declaration is found in the same route
  • Document the precedence, and this behavior

Reproduction

I'm not going to create a reproduction, since I'll be fixing this -- but if you want to do it yourself, create all three of the files mentioned above in a [slug] route, export entries from all three (with different return values), then run build. You'll only get the values from one of them built.

Logs

No response

System Info

no

Severity

annoyance

Additional Information

I also considered that we could merge the results from all of the entries exports, but that seems like encouraging silly behavior -- there's not any conceivable reason to want to have multiple entries exports per route.

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