You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this change result = await nodeLess.render
Read the less file if it is an empty file,result.map will be undefined,JSON.parse(result.map) will throw an error
$ tsc && vite build
vite v2.9.0-beta.6 building for production...
✓ 583 modules transformed.
[vite:css] Unexpected token u in JSON at position 0
file: /***/index.less
error during build:
SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse ()
at less (/node_modules/vite/dist/node/chunks/dep-7a3b37e3.js:19517:22)
at async compileCSS /node_modules/vite/dist/node/chunks/dep-7a3b37e3.js:19051:34)
at async Object.transform (/node_modules/vite/dist/node/chunks/dep-7a3b37e3.js:18691:55)
at async transform (/node_modules/rollup/dist/shared/rollup.js:21994:16)
at async ModuleLoader.addModuleSource /node_modules/rollup/dist/shared/rollup.js:22220:30)
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 https://github.com/vuejs/core instead.
Describe the bug
this change
result = await nodeLess.render
Read the less file if it is an empty file,
result.map
will beundefined
,JSON.parse(result.map)
will throw an errorhere vite/src/node/plugins/css.ts#L1299
$ tsc && vite build
vite v2.9.0-beta.6 building for production...
✓ 583 modules transformed.
[vite:css] Unexpected token u in JSON at position 0
file: /***/index.less
error during build:
SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse ()
at less (/node_modules/vite/dist/node/chunks/dep-7a3b37e3.js:19517:22)
at async compileCSS /node_modules/vite/dist/node/chunks/dep-7a3b37e3.js:19051:34)
at async Object.transform (/node_modules/vite/dist/node/chunks/dep-7a3b37e3.js:18691:55)
at async transform (/node_modules/rollup/dist/shared/rollup.js:21994:16)
at async ModuleLoader.addModuleSource /node_modules/rollup/dist/shared/rollup.js:22220:30)
Reproduction
x
System Info
Used Package Manager
yarn
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: