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
If the issue is related to 1.x -> 2.0 upgrade, read the Migration Guide first.
Describe the bug
In the vue project created with vite (jsx added):
npm run dev
Output:
2:36:51 PM [vite] Internal server error: Cannot read property 'length' of undefined
at posToNumber (/Users/kite/vite/packages/vite/src/node/utils.ts:204:23)
at Object.generateCodeFrame (/Users/kite/vite/packages/vite/src/node/utils.ts:237:11)
at formatError (/Users/kite/vite/packages/vite/src/node/server/pluginContainer.ts:311:34)
at TransformContext.error (/Users/kite/vite/packages/vite/src/node/server/pluginContainer.ts:276:13)
at Object.transform (/Users/kite/vite/packages/vite/src/node/server/pluginContainer.ts:521:15)
After investigation, the css code in the .less file references an undefined variable.
However, vite’s internal error information covers the valuable error information needed.
Expected output:
2:35:54 PM [vite] Internal server error: variable @mini-heights is undefined
Plugin: vite:css
File: /Users/kite/my-vue-app/src/styles/index.less
at less (/Users/kite/vite/packages/vite/src/node/plugins/css.ts:533:42)
at compileCSS (/Users/kite/vite/packages/vite/src/node/plugins/css.ts:329:36)
at TransformContext.transform (/Users/kite/vite/packages/vite/src/node/plugins/css.ts:88:42)
at Object.transform (/Users/kite/vite/packages/vite/src/node/server/pluginContainer.ts:517:20)
at Object.transformRequest (/Users/kite/vite/packages/vite/src/node/server/transformRequest.ts:123:27)
at /Users/kite/vite/packages/vite/src/node/server/middlewares/transform.ts:119:24
Package manager (npm/yarn/pnpm) and version: npm v6.14.4
Logs (Optional if provided reproduction)
2:36:51 PM [vite] Internal server error: Cannot read property 'length' of undefined
at posToNumber (/Users/kite/vite/packages/vite/src/node/utils.ts:204:23)
at Object.generateCodeFrame (/Users/kite/vite/packages/vite/src/node/utils.ts:237:11)
at formatError (/Users/kite/vite/packages/vite/src/node/server/pluginContainer.ts:311:34)
at TransformContext.error (/Users/kite/vite/packages/vite/src/node/server/pluginContainer.ts:276:13)
at Object.transform (/Users/kite/vite/packages/vite/src/node/server/pluginContainer.ts:521:15)
The text was updated successfully, but these errors were encountered:
Describe the bug
In the vue project created with vite (jsx added):
Output:
After investigation, the css code in the .less file references an undefined variable.
However, vite’s internal error information covers the valuable error information needed.
Expected output:
Reproduction
https://github.com/cllemon/my-vue-app
System Info
vite
version: v2.0.0-beta.34Logs (Optional if provided reproduction)
The text was updated successfully, but these errors were encountered: