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

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

Closed
1 task done
mauriziocescon opened this issue Dec 27, 2024 · 0 comments · Fixed by #29268
Closed
1 task done

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

mauriziocescon opened this issue Dec 27, 2024 · 0 comments · Fixed by #29268

Comments

@mauriziocescon
Copy link

mauriziocescon commented Dec 27, 2024

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
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jan 7, 2025
Ensure files with names resembling bundles, such as `main.js`, can be served correctly. This resolves issues where specific filenames were mistakenly treated as generated bundles, preventing them from being accessed directly.

Closes angular#29232
alan-agius4 added a commit that referenced this issue Jan 7, 2025
Ensure files with names resembling bundles, such as `main.js`, can be served correctly. This resolves issues where specific filenames were mistakenly treated as generated bundles, preventing them from being accessed directly.

Closes #29232
alan-agius4 added a commit that referenced this issue Jan 7, 2025
Ensure files with names resembling bundles, such as `main.js`, can be served correctly. This resolves issues where specific filenames were mistakenly treated as generated bundles, preventing them from being accessed directly.

Closes #29232

(cherry picked from commit ef3dc2e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants