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 don't return with concurrentFeatures #30586

Closed
bduff9 opened this issue Oct 28, 2021 · 2 comments · Fixed by #31227
Closed

API routes don't return with concurrentFeatures #30586

bduff9 opened this issue Oct 28, 2021 · 2 comments · Fixed by #31227

Comments

@bduff9
Copy link

bduff9 commented Oct 28, 2021

What version of Next.js are you using?

12.0.2-canary.6

What version of Node.js are you using?

14.17.0

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying your application?

Vercel

Describe the Bug

A freshly generated next app does not seem to allow API routes when concurrentFeatures is turned on. The browser never loads anything and the console displays output similar to the following:

wait  - compiling /api/hello (server only)...
wait  - compiling...
event - compiled successfully in 498 ms (281 modules)
error - Error: Cannot find module for page: /api/hello
wait  - compiling /_error...
wait  - compiling...
event - compiled successfully in 160 ms (284 modules)

Expected Behavior

API routes to not be affected by concurrentFeatures. If I turn them off, the API routes load as expected.

To Reproduce

  1. Generate a new next app with npx create-next-app --ts --use-npm
  2. cd into the new app directory and edit the next.config.js file to add the concurrentFeatures flag like so:
module.exports = {
  experimental: {
    concurrentFeatures: true
  }
}
  1. Save and run npm run dev
  2. Try to navigate to localhost:3000/api/hello
  3. The page will never load and you will see the following error in the console:
Error: Cannot find module for page: /api/hello
@bduff9 bduff9 added the bug Issue was opened via the bug report template. label Oct 28, 2021
@timneutkens timneutkens added area: Concurrent Features and removed bug Issue was opened via the bug report template. labels Oct 29, 2021
@timneutkens timneutkens added this to the 12.0.x milestone Oct 29, 2021
@shuding shuding added this to To do in React Server Components in Next.js (Alpha) via automation Nov 4, 2021
@styfle styfle modified the milestones: 12.0.x, 12.0.4 Nov 5, 2021
@shuding
Copy link
Member

shuding commented Nov 9, 2021

Hey! I tested locally that with the latest next@canary (>= 12.0.4-canary.3) API routes are now working as expected, so this should have been fixed by a previous PR. Also adding #31227 to avoid future regression.

Please let us know if you can still reproduce this issue :)

@kodiakhq kodiakhq bot closed this as completed in #31227 Nov 9, 2021
React Server Components in Next.js (Alpha) automation moved this from To do to Done Nov 9, 2021
kodiakhq bot pushed a commit that referenced this issue Nov 9, 2021
…31227)

Ensures that API routes are working as expected with `concurrentFeatures: true`. Closes #30586.

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
natew pushed a commit to natew/next.js that referenced this issue Feb 16, 2022
…ercel#31227)

Ensures that API routes are working as expected with `concurrentFeatures: true`. Closes vercel#30586.

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

5 participants