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

API routes are broken in development for serverless target #7617

Closed
kevva opened this issue Jun 20, 2019 · 2 comments · Fixed by #7619
Closed

API routes are broken in development for serverless target #7617

kevva opened this issue Jun 20, 2019 · 2 comments · Fixed by #7619

Comments

@kevva
Copy link
Contributor

kevva commented Jun 20, 2019

When creating API routes introduced in #7296 using the serverless target, they break in development because of this line where it tries to resolve the files in the serverless folder which doesn't exist in development. The solution would be to add a check for this.renderOpts.dev as we do here.

You can reproduce this by doing the following:

  1. Create a API route in pages/api
  2. Run now dev
  3. Try accessing the route
  4. There should be an error
@lfades
Copy link
Member

lfades commented Jun 20, 2019

@huv1k Will your PR fix this ?

@huv1k
Copy link
Contributor

huv1k commented Jun 20, 2019

@lfades yes :)

@lock lock bot locked as resolved and limited conversation to collaborators Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants