Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build with test mode #1627

Open
undergroundwires opened this issue Dec 28, 2021 · 2 comments
Open

Cannot build with test mode #1627

undergroundwires opened this issue Dec 28, 2021 · 2 comments

Comments

@undergroundwires
Copy link

undergroundwires commented Dec 28, 2021

Tested using

  • export NODE_ENV=test & npm run electron:build -- --publish never
  • vue-cli-service electron:build "--publish" "never" "--mode" "test"

Both fails with:

 ERROR  WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.mode should be one of these:
   "development" | "production" | "none"
   -> Enable production optimizations or development hints.
WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.mode should be one of these:
   "development" | "production" | "none"
   -> Enable production optimizations or development hints.
    at webpack (/home/bob/user/dev/undergroundwires/privacy.sexy/node_modules/webpack/lib/webpack.js:31:9)
    at bundleMain (/home/bob/user/dev/undergroundwires/privacy.sexy/node_modules/vue-cli-plugin-electron-builder/index.js:699:17)
    at /home/bob/user/dev/undergroundwires/privacy.sexy/node_modules/vue-cli-plugin-electron-builder/index.js:180:49
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

However they're officially supported Vue modes https://cli.vuejs.org/guide/mode-and-env.html and should be supported with vue-cli-plugin-electron-builder too. Maybe we could separate what's being sent to Vue to build and what we use as NODE_ENV to build?

It could also resolve #1626.

I believe it's reproducible with any repository, but I tested with privacy.sexy:

  1. git clone https://github.com/undergroundwires/privacy.sexy.git
  2. git checkout 0.11.3 (because master is subject to change`
  3. Run any of commands mentioned here.
undergroundwires added a commit to undergroundwires/privacy.sexy that referenced this issue Dec 29, 2021
Run quality checks for every possible OS because behavior of linting
rules may change per OS (e.g. `linebreak-style` ESLint assertment varies
by Unix-like vs Windows).

Add a new check to ensure project can be built:
  1. As both web and desktop applications.
    Different jobs are used due to nonidentical environment/mode support.
    Reference: nklayman/vue-cli-plugin-electron-builder#1627.
  2. Targeting all possible modes.
    The modes are configured using `--mode` but electron CLI checks
    `NODE_ENV` so it's set as well.
    Reference: nklayman/vue-cli-plugin-electron-builder#1626.

  3. On and for different operating systems.

Fix typo "Run units" instead of "Run unit tests".

Link to specific GitHub actions page for workflow runs.

Update documentation to match new structure, and change nontransparent
icons from the diagram and consistently use imperative for actions.

Rename `release-site` , `release-git`, `release-desktop` to
`site-release` , `git-release` and `desktop-release` to not be Yoda.
undergroundwires added a commit to undergroundwires/privacy.sexy that referenced this issue Dec 29, 2021
Run quality checks for every possible OS because behavior of linting
rules may change per OS (e.g. `linebreak-style` ESLint assertment varies
by Unix-like vs Windows).

Add a new check to ensure project can be built:
  1. As both web and desktop applications.
    Different jobs are used due to nonidentical environment/mode support.
    Reference: nklayman/vue-cli-plugin-electron-builder#1627.
  2. Targeting all possible modes.
    The modes are configured using `--mode` but electron CLI checks
    `NODE_ENV` so it's set as well.
    Reference: nklayman/vue-cli-plugin-electron-builder#1626.

  3. On and for different operating systems.

Fix typo "Run units" instead of "Run unit tests".

Link to specific GitHub actions page for workflow runs.

Update documentation to match new structure, and change nontransparent
icons from the diagram and consistently use imperative for actions.

Rename `release-site` , `release-git`, `release-desktop` to
`site-release` , `git-release` and `desktop-release` to not be Yoda.
undergroundwires added a commit to undergroundwires/privacy.sexy that referenced this issue Dec 30, 2021
Run quality checks for every possible OS because behavior of linting
rules may change per OS (e.g. `linebreak-style` ESLint assertment varies
by Unix-like vs Windows).

Add a new check to ensure project can be built:
  1. As both web and desktop applications.
    Different jobs are used due to nonidentical environment/mode support.
    Reference: nklayman/vue-cli-plugin-electron-builder#1627.
  2. Targeting all possible modes.
    The modes are configured using `--mode` but electron CLI checks
    `NODE_ENV` so it's set as well.
    Reference: nklayman/vue-cli-plugin-electron-builder#1626.

  3. On and for different operating systems.

Fix typo "Run units" instead of "Run unit tests".

Link to specific GitHub actions page for workflow runs.

Update documentation to match new structure, and change nontransparent
icons from the diagram and consistently use imperative for actions.

Rename `release-site` , `release-git`, `release-desktop` to
`site-release` , `git-release` and `desktop-release` to not be Yoda.
@nklayman
Copy link
Owner

nklayman commented Jan 6, 2022

NODE_ENV is used to set the webpack mode. What's causing the issue is that --mode test sets NODE_ENV to test as well which webpack doesn't like. I'll fix this in v3, and I can backport it to v2 and release a hotfix if you need it. You can also create a .env.test file with NODE_ENV=production to fix this.

@undergroundwires
Copy link
Author

Thanks. Happy to see you back. You're empowering majority of Vue desktop ecosystem behind the scenes and your work is much appreciated.

LarrMarburger pushed a commit to LarrMarburger/privacy.sexy that referenced this issue Nov 16, 2023
Run quality checks for every possible OS because behavior of linting
rules may change per OS (e.g. `linebreak-style` ESLint assertment varies
by Unix-like vs Windows).

Add a new check to ensure project can be built:
  1. As both web and desktop applications.
    Different jobs are used due to nonidentical environment/mode support.
    Reference: nklayman/vue-cli-plugin-electron-builder#1627.
  2. Targeting all possible modes.
    The modes are configured using `--mode` but electron CLI checks
    `NODE_ENV` so it's set as well.
    Reference: nklayman/vue-cli-plugin-electron-builder#1626.

  3. On and for different operating systems.

Fix typo "Run units" instead of "Run unit tests".

Link to specific GitHub actions page for workflow runs.

Update documentation to match new structure, and change nontransparent
icons from the diagram and consistently use imperative for actions.

Rename `release-site` , `release-git`, `release-desktop` to
`site-release` , `git-release` and `desktop-release` to not be Yoda.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants