Closed cognivore closed 2 years ago
This project doesn't use webpack either.
@jedisct1 fair enough, it is interesting -- however -- where does the source file here /home/sweater/github/do-auth/priv/ui/node_modules/libsodium/dist/modules
expects to find path
module in a browser? How do you get around it?
It's fairly hard to read the minified code, perhaps if you could point some pointers on how path
module is used in libsodium-wrapper, it would help a lot.
The same behaviour occurs when using a vue project with typescript and vue-cli version 5.
The path error is fixable by adding the mentioned path-browserify.
First install it:
npm i path-browserify -D
Second add it to the tsconfig.json to compilerOptions.paths as:
"path": [ "./node_modules/path-browserify" ]
Than the error is gone but a new warning is created:
warning in ./node_modules/libsodium/dist/modules/libsodium.js Module not found: Error: Can't resolve 'crypto' in
Trying to fix this the same way with crypto-browserify doesn't work.
// EDIT
With crypto-js it works:
"crypto": [ "./node_modules/crypto-js" ]
I'm trying to use
libsodium-wrapper
with an app made out of this template: \https://github.com/doma-engineering/cra-template-multi-nix without ejecting. When I run the server, I getI'll try to see what can I do, but so far I'm very confused where does webpack error even come from, since neither my template, nor this repo has any webpack.config.js files in it.