Skip to content

Using next/link.js in an ESM app causes a hard reload / full ESM support via subpath exports for next #77200

@amannn

Description

@amannn

Link to the code that reproduces this issue

amannn/nextjs-bug-repro-linkjs@eedf0a9

To Reproduce

  1. pnpm i
  2. pnpm run dev
  3. Open homepage
  4. Click on link to /test

Current vs. Expected behavior

Currently, the target page is opened with a hard reload. I'd expect it to use soft navigation—same as when using next/link without the explicit file extension.

Provide environment information

Operating System:
  Platform: darwin
  Arch: x64
  Version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:00 PDT 2024; root:xnu-10063.141.2~1/RELEASE_X86_64
  Available memory (MB): 16384
  Available CPU cores: 12
Binaries:
  Node: 20.11.1
  npm: 10.2.4
  Yarn: 1.22.22
  pnpm: 9.15.4
Relevant Packages:
  next: 15.3.0-canary.11 // Latest available version is detected (15.3.0-canary.11).
  eslint-config-next: N/A
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.8.2
Next.js Config:
  output: N/A

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

Linking and Navigating

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

next dev (local)

Additional context

amannn/next-intl#1796 (comment)

https://next-intl.dev/docs/environments/testing#vitest

microsoft/playwright#35162

#68455

Metadata

Metadata

Assignees

No one assigned

    Labels

    Linking and NavigatingRelated to Next.js linking (e.g., <Link>) and navigation.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions