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
Then, I debug vite2.0.0-alpha.5 and found something maybe the reason of bug.
When id is utils/types.ts, transformResult.code is '' and typeof transformResult === 'object' && !transformResult.code will be true, the transform result will be treated as no tramsform applied, so the returned code is source code which contains type definition and cause the error in browser console.
Maybe !transformResult.code can change to transformResult.code === code?
node_modules/vite/dist/node/chunks/dep-95ff8110.js line 66700 to 66723.transformRequest
6maple
changed the title
[2.0.0-alpha.5:yarn dev]: Code trasform result contains type definition when transform .ts file
[2.0.0-alpha.5:yarn dev]: Code trasform result contains type definition when transforming .ts file
Jan 1, 2021
Code trasform result contains type definition when transform .ts file
After checking file response in
Devtool Network
, I got:Then, I debug vite2.0.0-alpha.5 and found something maybe the reason of bug.
When
id
isutils/types.ts
,transformResult.code
is''
andtypeof transformResult === 'object' && !transformResult.code
will be true, the transform result will be treated asno tramsform applied
, so the returned code is source code which contains type definition and cause the error in browser console.node_modules/vite/dist/node/chunks/dep-95ff8110.js
line 66700 to 66723.transformRequestReproduction
https://github.com/6maple/test-vite/tree/vite2.0.0-alpha.5-demo-bug2021.1.1
System Info
vite
version:2.0.0-alpha.5
windows 10
12.14.1
The text was updated successfully, but these errors were encountered: