https://i.sstatic.net/k1MVW.png
Working on a project using NeoVim with CoC for TypeScript development in a yarn-3 pnp-enabled environment. Suddenly, the editor stopped recognizing imports and started showing errors for non-existent modules (refer to the screenshot). I've already set up SDK for Vim, installed TypeScript SDKs, updated yarn, and restarted the editor. Here are some system details: OS:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"
Neovim:
NVIM v0.7.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fc88999d91d78a9591bc888e9d9f97998ed298999e959d92d2938e9b">[email protected]</a>
package.json:
{
"private": true,
...
"devDependencies": {
"typescript": "4.5.5",
},
"packageManager": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e19880938fa1d2cfd4cfd1">[email protected]</a>"
}
.yarnrc.yml
checksumBehavior: update
nodeLinker: pnp
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
spec: "@yarnpkg/plugin-typescript"
yarnPath: .yarn/releases/yarn-3.5.0.cjs
tsconfig.json:
{
"compilerOptions": {
"outDir": "./dist/",
"noImplicitAny": true,
"skipLibCheck": true,
"module": "es6",
"target": "es6",
"jsx": "react",
"allowJs": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"paths": {
"@company/xxx-rqb": ["./packages/xxx-rqb/src"]
}
},
"exclude": ["**/*.test.ts", "**/*.spec.ts"]
}
.vim/coc-settings.json:
{
"eslint.packageManager": "yarn",
"eslint.nodePath": ".yarn/sdks",
"workspace.workspaceFolderCheckCwd": false,
"tsserver.tsdk": ".yarn/sdks/typescript/lib"
}
CocInfo:
## versions
vim version: NVIM v0.7.2
node version: v16.15.1
coc.nvim version: 0.0.82-b7375d5f 2023-01-30 05:09:03 +0800
coc.nvim directory: /home/user/.nvim/plugin/coc.nvim
term: tmux
platform: linux
## Log of coc.nvim
2023-04-11T18:17:33.885 INFO (pid:911582) [configurations] - Add folder configuration from cwd: /home/user/dev/reactfrontend/.vim/coc-settings.json
2023-04-11T18:17:34.057 INFO (pid:911582) [plugin] - coc.nvim initialized with node: v16.15.1 after 224
...
coc-tsserver veriosn 2.1.3 (latest)
All plugins are updated.
Yarn SDKs installed for typescript, prettier, eslint. Integrations: vim.
I've tried updating yarn, upgrading SDKs, neovim, and reinstalling dependencies. Even ran yarn tsc on a simple file without issues. Still facing the import problem.