Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
// https://karma-runner.github.io/1.0/config/configuration-file.html

const path = require('path');
process.env.CHROME_BIN = require('puppeteer').executablePath();

// Resolve from relative paths to absolute paths within the bazel runfiles tree
// so subprocesses spawned in a different working directory can still find them.
process.env.CHROME_BIN = process.env.CHROME_BIN ? path.resolve(path.join(process.cwd(), '..', '..', '..'), process.env.CHROME_BIN) : require('puppeteer').executablePath();

module.exports = function(config) {
config.set({
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"lodash": "^4.17.21",
"magic-string": "0.30.21",
"prettier": "^3.0.0",
"puppeteer": "18.2.1",
"puppeteer": "24.37.5",
"quicktype-core": "23.2.6",
"rollup": "4.59.0",
"rollup-license-plugin": "~3.1.0",
Expand All @@ -144,7 +144,6 @@
},
"pnpm": {
"onlyBuiltDependencies": [
"puppeteer",
"webdriver-manager"
],
"overrides": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ describeServeBuilder(executeDevServer, DEV_SERVER_BUILDER_INFO, (harness, setupT
// See: https://github.com/angular/angular-cli/pull/17624
// eslint-disable-next-line max-len
// executablePath: '/Users/<USERNAME>/git/angular-cli/node_modules/puppeteer/.local-chromium/mac-818858/chrome-mac/Chromium.app/Contents/MacOS/Chromium',
ignoreHTTPSErrors: true,
acceptInsecureCerts: true,
args: ['--no-sandbox', '--disable-gpu'],
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

import { Architect, BuilderRun } from '@angular-devkit/architect';
import path from 'node:path';
// eslint-disable-next-line import/no-extraneous-dependencies
import puppeteer, { Browser, Page } from 'puppeteer';
import { debounceTime, switchMap, take } from 'rxjs';
Expand All @@ -28,12 +29,10 @@ describe('Dev Server Builder HMR', () => {

beforeAll(async () => {
browser = await puppeteer.launch({
// MacOSX users need to set the local binary manually because Chrome has lib files with
// spaces in them which Bazel does not support in runfiles
// See: https://github.com/angular/angular-cli/pull/17624
// eslint-disable-next-line max-len
// executablePath: '/Users/<USERNAME>/git/angular-cli/node_modules/puppeteer/.local-chromium/mac-800071/chrome-mac/Chromium.app/Contents/MacOS/Chromium',
args: ['--no-sandbox', '--disable-gpu'],
executablePath: process.env.CHROME_BIN
? path.resolve(path.join(process.cwd(), '..', '..', '..'), process.env.CHROME_BIN)
: undefined,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/* eslint-disable import/no-extraneous-dependencies */
import { tags } from '@angular-devkit/core';
import { createServer } from 'node:http';
import path from 'node:path';
import { createProxyServer } from 'http-proxy';
import { AddressInfo } from 'node:net';
import { setTimeout as setTimeoutPromise } from 'node:timers/promises';
Expand Down Expand Up @@ -156,12 +157,10 @@ describeServeBuilder(

beforeAll(async () => {
browser = await puppeteer.launch({
// MacOSX users need to set the local binary manually because Chrome has lib files with
// spaces in them which Bazel does not support in runfiles
// See: https://github.com/angular/angular-cli/pull/17624
// eslint-disable-next-line max-len
// executablePath: '/Users/<USERNAME>/git/angular-cli/node_modules/puppeteer/.local-chromium/mac-818858/chrome-mac/Chromium.app/Contents/MacOS/Chromium',
ignoreHTTPSErrors: true,
executablePath: process.env.CHROME_BIN
? path.resolve(path.join(process.cwd(), '..', '..', '..'), process.env.CHROME_BIN)
: undefined,
acceptInsecureCerts: true,
args: ['--no-sandbox', '--disable-gpu'],
});
});
Expand Down
Loading