Skip to content

Building a component library with tsup that uses next/image breaks when one of the components directly renders Image since 13.4.8-canary.9 #52216

@rodrigoehlers

Description

@rodrigoehlers

Verify canary release

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

Provide environment information

This outputs seems to have issues with pnpm (?) monorepos. I've corrected the versions.
    Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 22.5.0: Thu Jun  8 22:22:20 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6000
    Binaries:
      Node: 18.13.0
      npm: 9.3.1
      Yarn: 1.22.19
      pnpm: 8.6.0
    Relevant Packages:
      next: 13.4.8 <-- I'm definitely using 13.4.9-canary.1 in the app (apps/web).
      eslint-config-next: N/A
      react: 18.2.0
      react-dom: 18.2.0
      typescript: N/A <-- 5.1.6 across all apps and packages
    Next.js Config:
      output: N/A

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

App directory (appDir: true), Image optimization (next/image, next/legacy/image)

Link to the code that reproduces this issue or a replay of the bug

https://github.com/rodrigoehlers/next-13.4.8-tsup-image-issue

or (quicker)

https://stackblitz.com/github/rodrigoehlers/next-13.4.8-tsup-image-issue?file=README.md

To Reproduce

See README.md in repository.

Describe the Bug

See README.md in repository.

Expected Behavior

See README.md in repository.

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

NEXT-1433

Metadata

Metadata

Assignees

Labels

Image (next/image)Related to Next.js Image Optimization.Module ResolutionModule resolution (CJS / ESM, module resolving).linear: nextConfirmed issue that is tracked by the Next.js team.locked

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions