Skip to content

Type definitions of exports are invalid #46689

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

Closed
1 task done
remcohaszing opened this issue Mar 2, 2023 · 3 comments
Closed
1 task done

Type definitions of exports are invalid #46689

remcohaszing opened this issue Mar 2, 2023 · 3 comments
Labels
bug Issue was opened via the bug report template. locked stale The issue has not seen recent activity. TypeScript Related to types with Next.js.

Comments

@remcohaszing
Copy link
Contributor

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
      Platform: linux
      Arch: x64
      Version: #202302091138~1675975749~22.04~f771a7f SMP PREEMPT_DYNAMIC Thu F
    Binaries:
      Node: 19.7.0
      npm: 9.5.1
      Yarn: 1.22.19
      pnpm: 7.27.0
    Relevant packages:
      next: 13.2.4-canary.0
      eslint-config-next: N/A
      react: 18.2.0
      react-dom: 18.2.0

Which area(s) of Next.js are affected? (leave empty if unsure)

TypeScript

Link to the code that reproduces this issue

N/A (not a runtime issue)

To Reproduce

Create a project with the following files:

// package.json
{
  "dependencies": {
    "@types/node": "^18.0.0",
    "@types/react": "18.0.0",
    "@types/react-dom": "^18.0.0",
    "next": "canary",
    "typescript": "^4.0.0"
  }
}
// tsconfig.json
{
  "compilerOptions": {
    "module": "commonjs",
    "jsx": "react-jsx",
    "noEmit": true
  }
}
// index.ts
import App from 'next/app'

const app = <App />

Run npm install, then typecheck using npx tsc.

Describe the Bug

This will show various errors. They are all related to Next.js using `esModuleInterop. Because of this, Next.js packages are affected by microsoft/TypeScript#52779.

Typical Next.js users don’t see this bug, because Next.js enforces people to use esModuleInterop, which hides the issue, but shouldn’t be necessary.

Expected Behavior

Next.js packages have proper type exports. This can be ensured by building without the esModuleInterop option.

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

@remcohaszing remcohaszing added the bug Issue was opened via the bug report template. label Mar 2, 2023
@github-actions github-actions bot added the TypeScript Related to types with Next.js. label Mar 2, 2023
@nextjs-bot
Copy link
Collaborator

This issue has been automatically marked as stale due to two years of inactivity. It will be closed in 7 days unless there’s further input. If you believe this issue is still relevant, please leave a comment or provide updated details. Thank you.

@nextjs-bot nextjs-bot added the stale The issue has not seen recent activity. label Feb 6, 2025
@nextjs-bot
Copy link
Collaborator

This issue has been automatically closed due to two years of inactivity. If you’re still experiencing a similar problem or have additional details to share, please open a new issue following our current issue template. Your updated report helps us investigate and address concerns more efficiently. Thank you for your understanding!

@nextjs-bot nextjs-bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 13, 2025
Copy link
Contributor

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 locked as resolved and limited conversation to collaborators Feb 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. locked stale The issue has not seen recent activity. TypeScript Related to types with Next.js.
Projects
None yet
Development

No branches or pull requests

2 participants