web-vault dist compilation fails #1878

Closed
opened 2025-10-09 17:34:15 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @pdarcos on GitHub.

Hi,

Trying to compile the web-vault according to the wiki. Running on Debian 10.2 with npm@6.7.0 and node@v11.15.0.

I cloned the original bitwarden git, applied your patch without problems, but when I try to compile it with npm it fails.

If I run npm run build:watch it works fine and starts listening on localhost:8080 as expected.

But if I try to build the production version according to your wiki instructions it fails

npm run dist

ERROR in node_modules/sweetalert/typings/sweetalert.d.ts(4,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'swal' must be of type 'typeof import("/root/tmp/web.prechanges.temp/node_modules/sweetalert/typings/sweetalert")', but here has type 'SweetAlert'.

Child html-webpack-plugin for "duo-connector.html":
1 asset
Entrypoint undefined = duo-connector.html
[0] ./node_modules/html-webpack-plugin/lib/loader.js!./src/connectors/duo.html 279 bytes {0} [built]
Child html-webpack-plugin for "index.html":
2 assets
Entrypoint undefined = index.html
[0] ./node_modules/html-webpack-plugin/lib/loader.js!./src/index.html 1.17 KiB {0} [built]
[1] ./src/images/logo-dark@2x.png 69 bytes {0} [built]
Child html-webpack-plugin for "u2f-connector.html":
1 asset
Entrypoint undefined = u2f-connector.html
[0] ./node_modules/html-webpack-plugin/lib/loader.js!./src/connectors/u2f.html 214 bytes {0} [built]
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! bitwarden-web@2.12.1 build:prod: gulp prebuild && cross-env NODE_ENV=production webpack
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the bitwarden-web@2.12.1 build:prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-12-22T21_25_15_407Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! bitwarden-web@2.12.1 dist: npm run build:prod && gulp postdist
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the bitwarden-web@2.12.1 dist script.

I can share full npm logs if that helps. When I ran npm install it did warn a bunch of times about the fsevents module not being compatible with linux, but that is an optional dependency and shouldn't break compilation.

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

Any clues as to why it won't compile?

Thanks

Originally created by @pdarcos on GitHub. Hi, Trying to compile the web-vault according to the wiki. Running on Debian 10.2 with npm@6.7.0 and node@v11.15.0. I cloned the original bitwarden git, applied your patch without problems, but when I try to compile it with npm it fails. If I run npm run build:watch it works fine and starts listening on localhost:8080 as expected. But if I try to build the production version according to your wiki instructions it fails [](https://github.com/dani-garcia/bitwarden_rs/wiki/Building-binary) npm run dist ERROR in node_modules/sweetalert/typings/sweetalert.d.ts(4,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'swal' must be of type 'typeof import("/root/tmp/web.prechanges.temp/node_modules/sweetalert/typings/sweetalert")', but here has type 'SweetAlert'. Child html-webpack-plugin for "duo-connector.html": 1 asset Entrypoint undefined = duo-connector.html [0] ./node_modules/html-webpack-plugin/lib/loader.js!./src/connectors/duo.html 279 bytes {0} [built] Child html-webpack-plugin for "index.html": 2 assets Entrypoint undefined = index.html [0] ./node_modules/html-webpack-plugin/lib/loader.js!./src/index.html 1.17 KiB {0} [built] [1] ./src/images/logo-dark@2x.png 69 bytes {0} [built] Child html-webpack-plugin for "u2f-connector.html": 1 asset Entrypoint undefined = u2f-connector.html [0] ./node_modules/html-webpack-plugin/lib/loader.js!./src/connectors/u2f.html 214 bytes {0} [built] npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! bitwarden-web@2.12.1 build:prod: `gulp prebuild && cross-env NODE_ENV=production webpack` npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the bitwarden-web@2.12.1 build:prod script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2019-12-22T21_25_15_407Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! bitwarden-web@2.12.1 dist: `npm run build:prod && gulp postdist` npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the bitwarden-web@2.12.1 dist script. I can share full npm logs if that helps. When I ran npm install it did warn a bunch of times about the fsevents module not being compatible with linux, but that is an optional dependency and shouldn't break compilation. npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) Any clues as to why it won't compile? Thanks
Author
Owner

@pdarcos commented on GitHub:

Fixed. Was an upstream bug in sweetalert

@pdarcos commented on GitHub: Fixed. Was an upstream bug in sweetalert
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#1878