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

Support ESM #47552

Closed
1 task done
jasonkuhrt opened this issue Mar 27, 2023 · 6 comments
Closed
1 task done

Support ESM #47552

jasonkuhrt opened this issue Mar 27, 2023 · 6 comments
Labels
bug Issue was opened via the bug report template. linear: next Confirmed issue that is tracked by the Next.js team. locked TypeScript Related to types with Next.js.

Comments

@jasonkuhrt
Copy link

jasonkuhrt commented Mar 27, 2023

Verify canary release

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

Provide environment information

Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 22.3.0: Mon Jan 30 20:38:37 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6000
    Binaries:
      Node: 16.19.0
      npm: 8.19.3
      Yarn: 1.22.19
      pnpm: 7.11.0
    Relevant packages:
      next: 13.2.4
      eslint-config-next: 13.2.4
      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

To Reproduce

Make app be ESM:

  1. "type": "module", in package.json
  2. "module": "NodeNext", in tsconfig.json
  3. "moduleResolution": "nodenext", in tsconfig.json

Watch imports from e.g. next/head fail.

Describe the Bug

Next.js is not an ESM package.

Expected Behavior

Next.js should be an ESM package.

Which browser are you using? (if relevant)

N/A

How are you deploying your application? (if relevant)

N/A

NEXT-2389

@jasonkuhrt jasonkuhrt added the bug Issue was opened via the bug report template. label Mar 27, 2023
@github-actions github-actions bot added the TypeScript Related to types with Next.js. label Mar 27, 2023
@samcx
Copy link
Member

samcx commented Mar 27, 2023

Did you update your next.config.js to next.config.cjs?

@jasonkuhrt
Copy link
Author

jasonkuhrt commented Mar 27, 2023

@samcx No, but I'm not sure how that is relevant. Also using CJS is a step in the wrong direction too. In the source code, one can see exports are not used in the package manifest. That is a problem.

@balazsorban44
Copy link
Member

balazsorban44 commented Feb 7, 2024

I can confirm this. here is a repro: https://github.com/balazsorban44/next-submodules-ts-nodenext

I took at stab at it in #61525 but as expected, it broke a lot of things. I'll see how we can tackle this more incrementally.

@balazsorban44 balazsorban44 added the linear: next Confirmed issue that is tracked by the Next.js team. label Feb 7, 2024
@karlhorky
Copy link
Contributor

karlhorky commented Sep 18, 2024

@balazsorban44 @samcx is this a duplicate of this other issue over here?

(the other issue has more upvotes and also a different PR #50357 from @lucgagan which aims to resolve it)

If yes, then these internal Linear tracking numbers are also duplicates:

@samcx
Copy link
Member

samcx commented Sep 19, 2024

@karlhorky That seems so, let's close this one and keep the older one.

@samcx samcx closed this as completed Sep 19, 2024
Copy link
Contributor

github-actions bot commented Oct 4, 2024

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 Oct 4, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 4, 2024
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. linear: next Confirmed issue that is tracked by the Next.js team. locked TypeScript Related to types with Next.js.
Projects
None yet
Development

No branches or pull requests

4 participants