-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Labels
bug: upstreamBug in a dependency of ViteBug in a dependency of Vitep2-edge-caseBug, but has workaround or limited in scope (priority)Bug, but has workaround or limited in scope (priority)
Description
Describe the bug
Wanted to reproduce a Less Bug with lightningcss, but I failed to create a usable reproduction.
When running in vite@7.1.2 everything works fine, with @vite.7.1.3 I got the error:
UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "ReferenceError: 𝐢𝐦𝐩𝐨𝐫𝐭 is not defined".
Simple vite config:
import { defineConfig } from 'vite';
export default defineConfig({
build: {
cssMinify: 'esbuild',
rollupOptions: {
input: ['src/main.js', 'src/test.less'],
},
},
});
Reproduction
https://stackblitz.com/edit/vitejs-vite-t2ppd7ej?file=vite.config.mjs
Steps to reproduce
Run npm install followed by npm run build.
With npm install vite@7.1.2 and npm run build, no error happens.
System Info
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 20.19.1 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.8.2 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
vite: ^7.1.3 => 7.1.3Used Package Manager
npm
Logs
Click to expand!
npm run build --debug
> vite-starter@0.0.0 build
> vite build
vite v7.1.3 building for production...
transforming (1) src/main.jsUnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "ReferenceError: 𝐢𝐦𝐩𝐨𝐫𝐭 is not defined".
at _0x545e32 (https://vitejsvitet2ppd7ej-o4tq.w-corp-staticblitz.com/blitz.96435430.js:31:22523)
at UnhandledPromiseRejection (node:internal/process/promises:193:1037)
at throwUnhandledRejectionsMode (node:internal/process/promises:193:4316)
at processPromiseRejections (node:internal/process/promises:193:5015)
at processTicksAndRejections (node:internal/process/task_queues:196:1218)
at <anonymous> (https://vitejsvitet2ppd7ej-o4tq.w-corp-staticblitz.com/blitz.96435430.js:31:552231) {
code: 'ERR_UNHANDLED_REJECTION'
}Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Metadata
Metadata
Assignees
Labels
bug: upstreamBug in a dependency of ViteBug in a dependency of Vitep2-edge-caseBug, but has workaround or limited in scope (priority)Bug, but has workaround or limited in scope (priority)