Skip to content

The error message indicating a missing CSS link is unfriendly. #788

@bpuns

Description

@bpuns

Related plugins

Describe the bug

vue component

<template>
  <div>1</div>
</template>

<style scoped src="./test.css"></style>

An error will occur if test.css does not exist.

[plugin vite:vue]
Error: ENOENT: no such file or directory, open '{project_path}\test.css'
    at Object.readFileSync (node:fs:441:20)

The error message says that '{project_path}\test.css' does not exist, and it cannot be located which Vue file imported test.css.

Reproduction

none

Steps to reproduce

No response

System Info

System:
    OS: Windows 11 10.0.26100
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700H
    Memory: 19.70 GB / 39.81 GB
  Binaries:
    Node: 22.18.0 - C:\Users\bpuns\AppData\Local\fnm_multishells\18884_1779418303504\node.EXE
    npm: 10.9.3 - C:\Users\bpuns\AppData\Local\fnm_multishells\18884_1779418303504\npm.CMD
    pnpm: 10.4.1 - C:\Users\bpuns\AppData\Local\fnm_multishells\18884_1779418303504\pnpm.CMD
  Browsers:
    Chrome: 148.0.7778.179
    Edge: Chromium (140.0.3485.66)
  npmPackages:
    @vitejs/plugin-vue: 6.0.7 => 6.0.7
    vite: ^8.0.12 => 8.0.14

Used Package Manager

pnpm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions