Skip to content

ng-serve: bundle main.js loaded instead of public/main.js #29232

Closed

Description

@mauriziocescon

Command

serve

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

19.0.0 (not sure which one changed the behaviour... but for sure 19.0.0 was fine)

Description

Hey!

It seems to me the current ng serve (cli 19.0.6) has a problem loading any file named main.js saved in the public folder. The issue is very easy to reproduce:

  • create a new project,
  • save a simple main.js in public/test,
  • run ng serve
  • open http://localhost:4200/test/main.js,
  • the main.js from the bundle is loaded.
Image

Minimal Reproduction

  • create a new project,
  • save a simple main.js in public/test,
  • run ng serve,
  • open http://localhost:4200/test/main.js,
  • the main.js from the bundle is loaded.

Your Environment

cli 19.0.6

Activity

  1. added a commit that references this issue on Jan 7, 2025
    99f020c
  2. added 2 commits that reference this issue on Jan 7, 2025
    ef3dc2e
    881095e
  3. angular-automatic-lock-bot commented on Feb 7, 2025

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  4. locked and limited conversation to collaborators on Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions