bitwarden fails to build #152

Closed
opened 2026-02-04 18:02:14 +03:00 by OVERLORD · 11 comments
Owner

Originally created by @micah686 on GitHub (Dec 11, 2018).

Trying to build without docker fails when running npm run dist. It gives a deprecation warning for plugins.scss, and fails with error code ELIFECYCLE.

Here is the output I get after trying to build it:

[sudo] password for username:

> bitwarden-web@2.6.2 dist /home/username/bitwarden_rs/web-vault
> npm run build:prod && gulp postdist


> bitwarden-web@2.6.2 build:prod /home/username/bitwarden_rs/web-vault
> gulp prebuild && cross-env NODE_ENV=production webpack

[17:10:50] Using gulpfile ~/bitwarden_rs/web-vault/gulpfile.js
[17:10:50] Starting 'prebuild'...
[17:10:50] Starting 'clean'...
[17:10:50] Finished 'clean' after 6.91 ms
[17:10:50] Starting 'webfonts'...
[17:10:50] Finished 'webfonts' after 752 ms
[17:10:50] Finished 'prebuild' after 762 ms
clean-webpack-plugin: /home/username/bitwarden_rs/web-vault/build/* has been remove                                                                                                 d.
DEPRECATION WARNING on line 3, column 8 of /home/username/bitwarden_rs/web-vault/src/scss/plugins.scss:
Including .css files with @import is non-standard behaviour which will be removed in future versions of LibSass.
Use a custom importer to maintain this behaviour. Check your implementations documentation on how to create a custom importer.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bitwarden-web@2.6.2 build:prod: `gulp prebuild && cross-env NODE_ENV=production webpack`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bitwarden-web@2.6.2 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!     /home/username/.npm/_logs/2018-12-11T01_50_12_761Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bitwarden-web@2.6.2 dist: `npm run build:prod && gulp postdist`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bitwarden-web@2.6.2 dist 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!     /home/username/.npm/_logs/2018-12-11T01_50_12_843Z-debug.log
username@ubuntu:~/bitwarden_rs/web-vault$
Originally created by @micah686 on GitHub (Dec 11, 2018). Trying to build without docker fails when running `npm run dist`. It gives a deprecation warning for plugins.scss, and fails with error code ELIFECYCLE. Here is the output I get after trying to build it: ```username@ubuntu:~/bitwarden_rs/web-vault$ sudo npm run dist [sudo] password for username: > bitwarden-web@2.6.2 dist /home/username/bitwarden_rs/web-vault > npm run build:prod && gulp postdist > bitwarden-web@2.6.2 build:prod /home/username/bitwarden_rs/web-vault > gulp prebuild && cross-env NODE_ENV=production webpack [17:10:50] Using gulpfile ~/bitwarden_rs/web-vault/gulpfile.js [17:10:50] Starting 'prebuild'... [17:10:50] Starting 'clean'... [17:10:50] Finished 'clean' after 6.91 ms [17:10:50] Starting 'webfonts'... [17:10:50] Finished 'webfonts' after 752 ms [17:10:50] Finished 'prebuild' after 762 ms clean-webpack-plugin: /home/username/bitwarden_rs/web-vault/build/* has been remove d. DEPRECATION WARNING on line 3, column 8 of /home/username/bitwarden_rs/web-vault/src/scss/plugins.scss: Including .css files with @import is non-standard behaviour which will be removed in future versions of LibSass. Use a custom importer to maintain this behaviour. Check your implementations documentation on how to create a custom importer. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! bitwarden-web@2.6.2 build:prod: `gulp prebuild && cross-env NODE_ENV=production webpack` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the bitwarden-web@2.6.2 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! /home/username/.npm/_logs/2018-12-11T01_50_12_761Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! bitwarden-web@2.6.2 dist: `npm run build:prod && gulp postdist` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the bitwarden-web@2.6.2 dist 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! /home/username/.npm/_logs/2018-12-11T01_50_12_843Z-debug.log username@ubuntu:~/bitwarden_rs/web-vault$ ```
Author
Owner

@mqus commented on GitHub (Dec 11, 2018):

This looks like an error some archlinux users also had (See the comments here: https://aur.archlinux.org/packages/bitwarden_rs-vault/)

The reason was insufficient main memory('compiling' vault needs far more than 1gb of ram)

@mqus commented on GitHub (Dec 11, 2018): This looks like an error some archlinux users also had (See the comments here: https://aur.archlinux.org/packages/bitwarden_rs-vault/) The reason was insufficient main memory('compiling' vault needs far more than 1gb of ram)
Author
Owner

@mqus commented on GitHub (Dec 11, 2018):

maybe relevant:https://github.com/bitwarden/web/issues/250

@mqus commented on GitHub (Dec 11, 2018): maybe relevant:https://github.com/bitwarden/web/issues/250
Author
Owner

@mprasil commented on GitHub (Dec 11, 2018):

#270 might also be related. But I believe the issue is essentially upstream and there's probably not much we can do here.

@mprasil commented on GitHub (Dec 11, 2018): #270 might also be related. But I believe the issue is essentially upstream and there's probably not much we can do here.
Author
Owner

@dani-garcia commented on GitHub (Dec 11, 2018):

The only solution I can think of, if someone is interested, is for us to provide a compiled version of the web vault directly.

@dani-garcia commented on GitHub (Dec 11, 2018): The only solution I can think of, if someone is interested, is for us to provide a compiled version of the web vault directly.
Author
Owner

@micah686 commented on GitHub (Dec 12, 2018):

So I gave my virtual machine more cores and more ram, and that fixed the issue. However, is the web vault architecture specific? So would you be able to compile it on x86, and then use the compiled version on ARM64, for instance?

@micah686 commented on GitHub (Dec 12, 2018): So I gave my virtual machine more cores and more ram, and that fixed the issue. However, is the web vault architecture specific? So would you be able to compile it on x86, and then use the compiled version on ARM64, for instance?
Author
Owner

@dani-garcia commented on GitHub (Dec 12, 2018):

No, the web vault is just a bunch of javascript and html, once compiled it should work anywhere.

@dani-garcia commented on GitHub (Dec 12, 2018): No, the web vault is just a bunch of javascript and html, once compiled it should work anywhere.
Author
Owner

@micah686 commented on GitHub (Dec 12, 2018):

maybe an option could be to set up AppVeyor or similar to pull the latest version on bitwarden web, and compile it.

@micah686 commented on GitHub (Dec 12, 2018): maybe an option could be to set up AppVeyor or similar to pull the latest version on bitwarden web, and compile it.
Author
Owner

@dani-garcia commented on GitHub (Dec 13, 2018):

I published the script I use to build the vault locally at https://github.com/dani-garcia/bw_web_builds, and uploaded the last three releases already compiled to the releases page. For now I don't think automation is necessary, as new releases of the web vault aren't that frequent.

I'll update the BUILD.md page to point to the compiled vault for those who are building the project manually and might prefer to avoid an extra step.

It might also be a good idea to use these in some of the docker images, particularly the ARM ones, as those systems usually have low amounts of ram. @mprasil, thoughts?

@dani-garcia commented on GitHub (Dec 13, 2018): I published the script I use to build the vault locally at https://github.com/dani-garcia/bw_web_builds, and uploaded the last three releases already compiled to the releases page. For now I don't think automation is necessary, as new releases of the web vault aren't that frequent. I'll update the BUILD.md page to point to the compiled vault for those who are building the project manually and might prefer to avoid an extra step. It might also be a good idea to use these in some of the docker images, particularly the ARM ones, as those systems usually have low amounts of ram. @mprasil, thoughts?
Author
Owner

@mprasil commented on GitHub (Dec 13, 2018):

Yeah perhaps we could do that. Our Dockerfiles are actually meant to be built on x86 device,(they don't work on ARM at all) so we have enough resources there to build the Vault, but it would probably cut down a bit from the build times.

Maybe we could use these in the main Dockerfile as well? That would make it a bit more universal for people who might want to build the image on non-x86 device.

@mprasil commented on GitHub (Dec 13, 2018): Yeah perhaps we could do that. Our Dockerfiles are actually meant to be built on x86 device,(they don't work on ARM at all) so we have enough resources there to build the Vault, but it would probably cut down a bit from the build times. Maybe we could use these in the main Dockerfile as well? That would make it a bit more universal for people who might want to build the image on non-x86 device.
Author
Owner

@dani-garcia commented on GitHub (Dec 13, 2018):

Cool, I updated all the dockerfiles to download it, then.

I decided to keep the three stage build, even though the first stage does barely nothing now, to keep the code similar in all of them.

@dani-garcia commented on GitHub (Dec 13, 2018): Cool, I updated all the dockerfiles to download it, then. I decided to keep the three stage build, even though the first stage does barely nothing now, to keep the code similar in all of them.
Author
Owner

@dani-garcia commented on GitHub (Dec 14, 2018):

All the dockerfiles are using a pre-compiled vault now, so this shouldn't be a problem anymore.

@dani-garcia commented on GitHub (Dec 14, 2018): All the dockerfiles are using a pre-compiled vault now, so this shouldn't be a problem anymore.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#152