Importing default from next/document
in ESM inside a third-party package doesn't work
#64796
Labels
next/document
in ESM inside a third-party package doesn't work
#64796
Link to the code that reproduces this issue
https://github.com/DiegoAndai/esm-test-8-next-document-monorepo?tab=readme-ov-file
To Reproduce
Follow instructions in: https://github.com/DiegoAndai/esm-test-8-next-document-monorepo?tab=readme-ov-file#running-the-repro
Current vs. Expected behavior
Current
When importing next/document.js from an ESM module, the default value is not properly set:
Expected
In ESM, the default import should be set with using the syntax:
Provide environment information
Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:22 PDT 2023; root:xnu-8796.121.3~7/RELEASE_X86_64 Available memory (MB): 16384 Available CPU cores: 16 Binaries: Node: 18.19.0 npm: 10.4.0 Yarn: 1.22.21 pnpm: 8.14.1 Relevant Packages: next: 14.2.2 // Latest available version is detected (14.2.2). eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0 typescript: N/A Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Pages Router
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local)
Additional context
Issue found when trying to add
exports
field to thematerial-nextjs
integration package.The text was updated successfully, but these errors were encountered: