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
getStaticProps
should not be able to fetch same-app API endpoints in development
#15031
Comments
We can do it using the new babel plugin warning system, however that will only get us as far as |
getStaticProps
should not be able to fetch API endpoints in developmentgetStaticProps
should not be able to fetch same-app API endpoints in development
I'm having the same situation. I want to make a request to the same-app API endpoints on the getStaticPaths. In development works when I run both, next dev and next build at the same time. |
Please verify that your issue can be recreated with Why was this issue marked with the
|
This issue has been automatically closed because it wasn't verified against next@canary. If you think it was closed by accident, please leave a comment. If you are running into a similar issue, please open a new issue with a reproduction. Thank you. |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Feature request
Next.js should make an attempt to block requests to same-app API endpoints (i.e. localhost) from
getStaticProps
duringnext dev
since they'll fail whennext build
is run.I'm not sure if this is even possible!
Describe the solution you'd like
For the following code, we should throw an error somehow:
The text was updated successfully, but these errors were encountered: