next.js icon indicating copy to clipboard operation
next.js copied to clipboard

SVG images imported in server components aren't included in bundle

Open twavv opened this issue 3 years ago • 1 comments

Verify canary release

  • [X] 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 21.6.0: Mon Aug 22 20:19:52 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T6000
    Binaries:
      Node: 16.14.0
      npm: 8.3.1
      Yarn: 1.22.19
      pnpm: 6.11.0
    Relevant packages:
      next: 13.0.2-canary.2
      eslint-config-next: 13.0.1
      react: 18.2.0
      react-dom: 18.2.0

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

When an SVG image is statically imported in a server component, it's not included in the resulting bundle (the HTTP request 404's when loaded in the browser). Things do work for non-SVG images and for SVGs imported in client components.

Expected Behavior

SVGs should work in RSCs.

Link to reproduction

https://github.com/travigd/nextjs13-image-rsc-import-repro

To Reproduce

See repo.

Screen Shot 2022-11-03 at 1 39 10 PM

twavv avatar Nov 03 '22 20:11 twavv

I can also confirm this happening, just hit this on my own project.

mlabrum avatar Nov 07 '22 05:11 mlabrum

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

github-actions[bot] avatar Dec 24 '22 00:12 github-actions[bot]