yarn pnp sdk 和 typescript 有什么不兼容的地方吗?我已经通过yarn sdks
TS 服务器日志安装了 sdk,它似乎是从缓存中提取的(例如:)
/osi/disp/vob/web/.yarn/cache/typescript-patch-04b86b0e5c-24a439e062.zip/node_modules/typescript/lib/lib.es5.d.ts
然而 VS Code 找不到模块:
Cannot find module 'react' or its corresponding type declarations.
它通过 webpack 构建和运行。这似乎是一个 VS Code/sdk 工件。
试图追踪反应分辨率有一些奇怪的注意事项:
Info 1216 [08:36:07.761] DirectoryWatcher:: Added:: WatchInfo: /osi/disp/vob/web/react 1 undefined Project: /osi/disp/vob/web/tsconfig.json WatchType: Failed Lookup Locations
Info 1217 [08:36:07.761] Elapsed:: 0.06486300379037857ms DirectoryWatcher:: Added:: WatchInfo: /osi/disp/vob/web/react 1 undefined Project: /osi/disp/vob/web/tsconfig.json WatchType: Failed Lookup Locations
这些文件夹不存在,似乎它可能被解释'react'
为'./react'
配置:
{
"compilerOptions": {
"baseUrl": "./",
"target": "es5",
"lib": [
"es6",
"dom",
"es2016",
"es2017"
],
"allowSyntheticDefaultImports": true,
"alwaysStrict": true,
"declaration": true,
"downlevelIteration": true,
"experimentalDecorators": true,
"jsx": "react",
"module": "commonjs",
"moduleResolution": "node",
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"removeComments": true,
"resolveJsonModule": true,
"skipLibCheck": true
}
}
简单复制: https ://github.com/rcketscientist/vs-code-pnp-test
感谢任何见解或指示以进一步调查。