ts-morph icon indicating copy to clipboard operation
ts-morph copied to clipboard

getPreEmitDiagnostics error TS2305: Module '"vue"' has no exported member 'defineComponent'

Open wuzhidexiaoming opened this issue 4 years ago • 1 comments

Hi, thanks for releasing your project, very helpful

I have encountered some problems in use. I am not sure whether it is a problem of pnpm or ts-morph. I think it is a configuration problem or a problem of ts-morph parsing, but I am not sure at the moment, so I am asking here for advice.

if use tsc --noEmit,no error,if use ts-morph,getPreEmitDiagnostics will return non-empty array

Version: 14.0.0 node version: v16.15.1 pnpm version: 7.4.0 os: x86_64 Linux 5.19.7-arch1-1

To Reproduce

code this repo https://github.com/wuzhidexiaoming/demo_ts.git src/ont.ts

git clone https://github.com/wuzhidexiaoming/demo_ts.git

cd demo_ts

pnpm install

pnpm run generatedts

// if run node temp.cjs,  same code but no problem 

should not generate an error error TS2305: Module '"vue"' has no exported member 'defineComponent'

other if use yarn install,then run yarn run generatedts, no error,but i use pnpm workspace, So can't switch to yarn

wuzhidexiaoming avatar Sep 13 '22 08:09 wuzhidexiaoming

@wuzhidexiaoming I have the same problem. How can I solve it

wangwenwen130 avatar Apr 25 '24 02:04 wangwenwen130