Skip to content

[Bug Report] 5.2.12 regression - dynamic css import will cause MODULE_NOT_FOUND in SSR build #17366

Closed
@meteorlxy

Description

@meteorlxy

Describe the bug

Dynamic import css file:
image

SSR build in 5.2.11:
image

SSR build in 5.2.12:
image

The file is removed, but it's still referenced in the SSR build, which will cause ERR_MODULE_NOT_FOUND when executing it

image

Reproduction

https://github.com/meteorlxy/vite-5-2-12-repro

Steps to reproduce

Check the reproduce repo

System Info

System:
    OS: macOS 14.4
    CPU: (10) arm64 Apple M1 Pro
    Memory: 62.78 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.12.2 - ~/Library/Caches/fnm_multishells/10557_1717167804709/bin/node
    npm: 10.5.0 - ~/Library/Caches/fnm_multishells/10557_1717167804709/bin/npm
    pnpm: 9.1.4 - ~/Library/Caches/fnm_multishells/10557_1717167804709/bin/pnpm
    Watchman: 2024.05.06.00 - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 125.0.6422.113
    Safari: 17.4

Used Package Manager

pnpm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    feat: cssfeat: ssrp3-minor-bugAn edge case that only affects very specific usage (priority)regressionThe issue only appears after a new release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions