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

CRITICAL: Fix 'Browserlist: caniuse-lite is outdated' error that prevents package building - [merged] #127

Closed
benloh opened this issue Apr 17, 2020 · 5 comments
Assignees

Comments

@benloh
Copy link
Contributor

benloh commented Apr 17, 2020

In GitLab by @daveseah on Apr 17, 2020, 16:29

Merges why-fix-package -> why

THE ISSUE

The Electron run/build process fails with the Browserlist: caniuse-lite is outdated. Please run next command 'npm update'. Running the npm update command doesn't fix the issue. The application completely breaks even when using npm run dev which worked before.

RESOLUTION

It is due to the Browserlist package emitting an unexpected error message that breaks the build process in server-express.js in Start():

    // add webpack middleware to express
    // also add the hot module reloading middleware
    const instance = wpack_mid(compiler, {
      // logLevel: 'silent', // turns off [wdm] messages
      publicPath: webConfig.output.publicPath,
      stats: 'errors-only' // see https://webpack.js.org/configuration/stats/
    });
/** BOOM! **/
    app.use(instance);
    app.use(wpack_hot(compiler));

This is a dumb error to force people to update browserlist. To troubleshoot issues of this nature:

  1. Looked through package-lock.json to find which installed packages use browserlist as a dependency. In our case, it was @babel/preset-env which was loading v7.6.2.
  2. Updated package.json to use the latest patch in the 7.6.x line, which is 7.6.4
  3. Do an npm install to regenerate package-lock.json
  4. See if it works using npm run dev, npm run electron
  5. See if the packaged version works with npm run package followed by npm run appsign finally npm run app

TO TEST

  1. Pull the merge request
  2. `nvm use
  3. npm ci
  4. npm run dev and see if app works
  5. npm run electron and see if it works
  6. npm run package and npm run appsign to see if it works
  7. npm run app or double-click the app to see if it works

ADDITIONAL NOTES

This merge request also updates .nvmrc to require node v10.20.1, the latest patch in the Node 10 line.

@benloh
Copy link
Contributor Author

benloh commented Apr 17, 2020

In GitLab by @daveseah on Apr 17, 2020, 16:29

unassigned @daveseah

@benloh
Copy link
Contributor Author

benloh commented Apr 18, 2020

mentioned in commit 32cdcdc

@benloh
Copy link
Contributor Author

benloh commented Apr 18, 2020

merged

@benloh
Copy link
Contributor Author

benloh commented Apr 18, 2020

Excellent! Thank you!

@benloh benloh self-assigned this Jun 28, 2023
@benloh benloh closed this as completed Jun 28, 2023
@benloh
Copy link
Contributor Author

benloh commented Oct 25, 2023

For the record, the "caniuse" problem resurfaces on occasion. See e.g. #135 comment. Using npx browserslist@latest --update-db is also a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant