import-cost icon indicating copy to clipboard operation
import-cost copied to clipboard

[coc.nvim]: UnhandledRejection: Cannot find module 'tslib'

Open dquevid opened this issue 2 years ago • 7 comments

I get this message when opening a .js file in NeoVim. I tried to install tslib in the extension directory, but another error occurred.

[coc.nvim]: UnhandledRejection: Cannot find module 'tslib' Require stack:

  • /home/dqvid/.config/coc/extensions/node_modules/coc-import-cost/lib/extension.js
  • /home/dqvid/.config/coc/extensions/node_modules/coc-import-cost/lib/extension.js Error: Cannot find module 'tslib' Require stack:
  • /home/dqvid/.config/coc/extensions/node_modules/coc-import-cost/lib/extension.js
  • /home/dqvid/.config/coc/extensions/node_modules/coc-import-cost/lib/extension.js at Module._resolveFilename (node:internal/modules/cjs/loader:1039:15) at Module._load (node:internal/modules/cjs/loader:885:27) at Module.require (node:internal/modules/cjs/loader:1105:19) at e (/home/dqvid/.local/share/nvim/plugged/coc.nvim/build/index.js:250:18040) at Object. (/home/dqvid/.config/coc/extensions/node_modules/coc-import-cost/lib/extension.js:3:17) at Module._compile (/home/dqvid/.local/share/nvim/plugged/coc.nvim/build/index.js:250:18366) at Module._extensions..js (node:internal/modules/cjs/loader:1272:10) at Module.load (node:internal/modules/cjs/loader:1081:32) at Module._load (node:internal/modules/cjs/loader:922:12) at Module.require (node:internal/modules/cjs/loader:1105:19)

dquevid avatar Dec 22 '22 14:12 dquevid

same with vscode, no consequence client side (just slow, and make github copilot crash), but vscode-server on linux machine keep crashing

tchereau avatar Dec 27 '22 12:12 tchereau

I haven't been able to figure this out either. I'm using:

nodejs v19.3.0

Tried installing tslib manually but now get a weird SSL error.

Nate-Wilkins avatar Feb 04 '23 03:02 Nate-Wilkins

I am able to reproduce this. Running off of a fresh coc + coc-import-cost combo I receive:

[coc.nvim]: UnhandledRejection: Cannot find module 'tslib'
Require stack:
- $HOME/.config/coc/extensions/node_modules/coc-import-cost/lib/extension.js
- $HOME/.config/coc/extensions/node_modules/coc-import-cost/lib/extension.js
Error: Cannot find module 'tslib'
- $HOME/.config/coc/extensions/node_modules/coc-import-cost/lib/extension.js
- $HOME/.config/coc/extensions/node_modules/coc-import-cost/lib/extension.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
    ...

I am running off of Fedora 37 with node v18.14.2.

markovejnovic avatar Mar 26 '23 00:03 markovejnovic

Not sure if it will solve the issue for people above, but I noticed that by going into $HOME/.config/coc/extensions/node_modules/coc-import-cost and running npm install fixed the missing dependency issue.

(Found this issue, because the bundle size calculation is not showing up for me at all and the above issue is one that I managed to solve...)

jeansibelius avatar Jul 11 '23 02:07 jeansibelius

FYI, https://github.com/barrett-ruth/import-cost.nvim is also built on wix/import-cost and I have had success with it

timtyrrell avatar Jul 11 '23 14:07 timtyrrell

Thanks for the recommendation! Looks like it's a neovim plugin, so I'd have to first get on neovim. Maybe this will be a good opportunity to give it a go!

jeansibelius avatar Jul 13 '23 02:07 jeansibelius

Not sure if it will solve the issue for people above, but I noticed that by going into $HOME/.config/coc/extensions/node_modules/coc-import-cost and running npm install fixed the missing dependency issue.

(Found this issue, because the bundle size calculation is not showing up for me at all and the above issue is one that I managed to solve...)

I have same issue

RichardSleet avatar Jan 30 '24 10:01 RichardSleet