Install new npm package for collab client
ruslanix opened this issue · 1 comments
ruslanix commented
I need to use jsonwebtoken
lib in collab client.
I did:
npm install jsonwebtoken
then in collabl client
import * as jwt from "jsonwebtoken";
When I open collab client I ended up with something like:
Uncaught Error: http://localhost:8888/moduleserve/mod/__/node_modules/safe-buffer/index/__mod/buffer: Not Found
It looks to me that somehow standard libraries are not properly linked by moduleserver.
How can I add npm packages?
marijnh commented
They aren't, no. You generally can't just load these in the browser, since they rely on node internals. There might be implementations that do work in the browser, but I'm not sure what the best way to link those would be.