Skip to content

fix(@angular/build): resolve dev-server sslKey and sslCert relative to the workspace root - #34399

Open
MeAkib wants to merge 4 commits into
angular:mainfrom
MeAkib:fix/dev-server-ssl-paths
Open

MeAkib wants to merge 4 commits into
angular:mainfrom
MeAkib:fix/dev-server-ssl-paths

Conversation

@MeAkib

@MeAkib MeAkib commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

The Vite-based dev server read sslKey and sslCert relative to the current working directory, so serving failed with ENOENT when ng serve ran from a subdirectory of the workspace and the paths in angular.json were relative. Resolve both paths against the workspace root, as the webpack dev server already does.

…ve to the workspace root

The Vite-based dev server read `sslKey` and `sslCert` relative to the current working directory,
so serving failed with `ENOENT` when `ng serve` ran from a subdirectory of the workspace and the
paths in `angular.json` were relative. Resolve both paths against the workspace root, as the
webpack dev server already does.

The new dev-server `ssl` spec covers relative paths. It fails with `ENOENT` without this change.

@alan-agius4 alan-agius4 left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be done in https://github.com/angular/angular-cli/blob/main/packages/angular/build/src/builders/dev-server/options.ts

Similar to

const tsconfig = path.join(workspaceRoot, options.tsConfig);
and
const fileReplaceWith = path.join(workspaceRoot, replacement.with);

@alan-agius4 alan-agius4 added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews target: patch This PR is targeted for the next patch release labels Oct 19, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Vite dev-server configuration to resolve the sslCert and sslKey paths relative to the workspace root. Additionally, a new test suite has been added to verify this behavior. There are no review comments, and I have no feedback to provide.

@MeAkib
MeAkib requested a review from alan-agius4 October 19, 2026 09:27
Comment thread packages/angular/build/src/builders/dev-server/options.ts
@MeAkib
MeAkib force-pushed the fix/dev-server-ssl-paths branch from 0ae6773 to 08e9727 Compare October 19, 2026 09:37
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Oct 19, 2026

@clydin clydin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks legitimate use cases such as:
ng serve --ssl --ssl-key "$HOME/.certs/key.pem" --ssl-cert "$HOME/.certs/cert.pem"

@clydin clydin removed the action: merge The PR is ready for merge by the caretaker label Oct 19, 2026
@MeAkib
MeAkib requested a review from clydin October 19, 2026 18:29
@alan-agius4 alan-agius4 added the action: review The PR is still awaiting reviews from at least one requested reviewer label Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer area: @angular/build target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants