wix / import-cost

displays the import size of the package you are importing inside the code editor
https://marketplace.visualstudio.com/items?itemName=wix.vscode-import-cost
MIT License
1.36k stars 66 forks source link

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

Open dquevid opened 1 year ago

dquevid commented 1 year ago

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:

tchereau commented 1 year ago

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

Nate-Wilkins commented 1 year ago

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.

markovejnovic commented 1 year ago

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.

jeansibelius commented 1 year ago

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...)

timtyrrell commented 1 year ago

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

jeansibelius commented 1 year ago

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!

RichardSleet commented 7 months ago

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