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

Module '"next/server"' has no exported member 'after'. #75189

Closed
oscar-b opened this issue Jan 22, 2025 · 2 comments · Fixed by #75190
Closed

Module '"next/server"' has no exported member 'after'. #75189

oscar-b opened this issue Jan 22, 2025 · 2 comments · Fixed by #75190
Labels

Comments

@oscar-b
Copy link

oscar-b commented Jan 22, 2025

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/xsdv25

To Reproduce

Try to use after from next/server results in error Type error: Module '"next/server"' has no exported member 'after'.

The error seems to be here:
https://github.com/vercel/next.js/blob/canary/packages/next/src/build/webpack/plugins/next-types-plugin/index.ts#L670

Seems to have been missed in #73605

Image

Current vs. Expected behavior

I should be able to import after

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:03:15 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 10
Binaries:
  Node: 20.18.0
  npm: 10.8.2
  Yarn: N/A
  pnpm: 9.12.1
Relevant Packages:
  next: 15.2.0-canary.19 // Latest available version is detected (15.2.0-canary.19).
  eslint-config-next: 15.1.3
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.5.3
Next.js Config:
  output: standalone

Which area(s) are affected? (Select all that apply)

Not sure

Which stage(s) are affected? (Select all that apply)

next build (local), next dev (local), next start (local), Vercel (Deployed), Other (Deployed)

Additional context

https://nextjs.org/docs/app/api-reference/functions/after clearly shows

import { after } from 'next/server'

Trying to use unstable_after like this (import { unstable_after as after } from 'next/server';) causes errors:

GET /en 200 in 1480ms
 ⨯ TypeError: (0 , __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$server$2e$js__$5b$app$2d$rsc$5d$__$28$ecmascript$29$__.unstable_after) is not a function
    at IndexPage (src/app/[locale]/(dashboard)/page.tsx:8:7)
   6 |  const t = await getTranslations('Index');
   7 |
>  8 |  after(async () => {
     |       ^
   9 |          console.log('after');
  10 |  });
  11 | {
  digest: '2064753410'
}
ztanner added a commit that referenced this issue Jan 22, 2025
Looks like this was missed when stabilizing the feature.

Fixes #75189
@oscar-b
Copy link
Author

oscar-b commented Jan 23, 2025

@ztanner You're welcome ;)

Copy link
Contributor

github-actions bot commented Feb 6, 2025

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot added the locked label Feb 6, 2025
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant