Support Chrome install on build bot for plugin execution
See original GitHub issueπ Hey! Iβm not sure if this is the correct place for issues/requests for the build plugin beta. If not, let me know!
Which problem is this feature request solving?
In attempting to develop a plugin, there doesnβt seem to be a way to select to have chrome install on the build image.
Example of the plugin, which utilizes https://github.com/GoogleChrome/lighthouse-ci
module.exports = {
name: "netlify-plugin-lighthouse",
onEnd: () => {
require("child_process").spawnSync(
"npx",
["@lhci/cli", "autorun", "--upload.target=temporary-public-storage"],
{
cwd: process.cwd(),
stdio: "inherit"
}
);
}
};
Output:
9:07:00 PM: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
9:07:00 PM: β 2. Running onEnd lifecycle from netlify-plugin-lighthouse β
9:07:00 PM: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
9:07:00 PM:
9:07:20 PM: npx: installed 372 in 17.372s
9:07:20 PM: β
.lighthouseci/ directory writable
9:07:20 PM: β οΈ Configuration file not found
9:07:20 PM: β Chrome installation not found
9:07:20 PM: ERROR: The environment variable CHROME_PATH must be set to executable of a build of Chromium version 54.0 or later.
9:07:20 PM: Healthcheck failed!
Describe the solution youβd like
A configuration option like Travis, or other CI providers would be great!
addons:
chrome: stable # make Chrome available
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Google Chrome extension troubleshooting
Installing it causes recording and runtime errors in bots that interact with the Google Chrome browser. Even if you did not manually install...
Read more >Automatically install apps and extensions - Google Support
You can automatically install (force-install) specific Chrome apps and extensions for users in your organization. Users then see these apps and extensionsΒ ...
Read more >Add UI Path extension in Chrome Browser without UiPath studio
This extension helps you create browser automations in Google Chrome.You can install this extension in multiple ways, as shown below: Install ...
Read more >Getting Started with Headless Chrome - Chrome Developers
Windows support came in Chrome 60. # Starting Headless (CLI). The easiest way to get started with headless mode is to open the...
Read more >karma-runner/karma-chrome-launcher - GitHub
GitHub - karma-runner/karma-chrome-launcher: A Karma plugin. ... project directory to be able to install plugins there (e.g. JetBrains IDE Support plugin).
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is amazing!
You should submit this to the plugins directory so Netlify starts displaying in the UI for other users π
Quick notes on this function:
utils.run()
utility which automatically sets the correct options forchild_process
inside Build plugins (includingstdio: 'inherit'
)try { getChromiumPath() } catch { await utils.run('npm install chromium') }
should be much faster and might be more reliable? Also the||
operator is Bash-specific so might not work for Windows users.yarn
instead ofnpm
But apart from those details, this is super useful!
Hello. So I stumbled upon this thread when looking for a way to enable Chrome in Netlify build. Ultimately I didnβt find a solution, so I decided to build one myself, and this thread was very helpful. You can find it here: https://github.com/soofka/netlify-plugin-chromium
Pretty sure it can be done better, I am modifying environmental variable in the process (although I enable configuration option to opt-out of this) so it smells a bit, but with it I was able to get Lighthouse CI to run with
lhci autorun
command in Netlify without issues. Hope it helps.