Skip to content

Layout.css not pulling in map from external package css import #80208

Open
@Huink7

Description

@Huink7

Link to the code that reproduces this issue

https://github.com/Huink7/css-map-reproduction

To Reproduce

  1. Include an external minified css file that includes a comment for source map in layout.tsx
  2. Start next dev (in safari with css source maps enabled)
  3. Observe

Current vs. Expected behavior

Safari tries to continually import layout.css and can't find the map.css. In our app (not the minimal reproducible) safari keeps trying to load layout.css and ends up importing multiple. I'm not entirely sure what would cause it to do that. However, in the min reproduction it does only happen once.

Example error:
Source Map loading errors
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:3000/_next/static/css/app/bootstrap.min.css.map

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:49 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 10
Binaries:
  Node: 22.15.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 15.3.3 // No Next.js version data was found.
  eslint-config-next: 15.3.3
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.7.3
Next.js Config:
  output: N/A

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

CSS

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

next dev (local)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    CSSRelated to CSS.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions