Skip to content

Dev server (ng serve) should return HTTP 404 for assets requests for broken/non-existent urls #2989

Closed

Description

@IgorMinar

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

MacOS El Capitan

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

angular-cli: 1.0.0-beta.19-3
node: 6.7.0
os: darwin x64

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

build an app and in the html template load an image that doesn't exist in the source repo

<img src="does/not/exist">

The log given by the failure.

Normally this include a stack trace and some more information.

dev server (ng serve) responds with HTTP 200 (and serves the contents index.html in the response) instead of HTTP 404.

Mention any other details that might be useful.

Please see johnpapa/lite-server#51 for explanation of why this results in very poor development experience and suggested fixes.


Thanks! We'll be in touch soon.

Activity

  1. valorkin commented on Nov 2, 2016

    @valorkin
    Contributor

    @Brocco fix added via PR

  2. IgorMinar commented on Nov 2, 2016

    @IgorMinar
    ContributorAuthor

    Awesome work! Thanks Dmitriy!

    On Wed, Nov 2, 2016 at 10:19 PM Dmitriy Shekhovtsov <
    notifications@github.com> wrote:

    @Brocco https://github.com/Brocco fix added via PR

    —
    You are receiving this because you authored the thread.
    Reply to this email directly, view it on GitHub
    #2989 (comment),
    or mute the thread
    https://github.com/notifications/unsubscribe-auth/AANM6ONLCCV7CkGEP02fsQb_0Syjcxvcks5q6P57gaJpZM4KnqdL
    .

  3. added a commit that references this issue on Nov 2, 2016
    86f2a1b
  4. filipesilva commented on Nov 2, 2016

    @filipesilva
    Contributor

    @valorkin thanks for the quick PR!

  5. added a commit that references this issue on Feb 9, 2017
    cc86215
  6. angular-automatic-lock-bot commented on Sep 6, 2019

    @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.

  7. locked and limited conversation to collaborators on Sep 6, 2019
  8. added a commit that references this issue on May 29, 2026
    b7cd9a9
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions