Skip to content

Service worker returning index page for nonexistent route #3299

Closed
@BrandonClapp

Description

@BrandonClapp

Is this a bug report?

Not sure. Trying to determine that.

Which terms did you search for in User Guide?

service worker

Environment

Node v6.9.2
NPM v3.10.9
react-scripts 1.0.14

Mac OSX El Capitan 10.11.6
Google Chrome Version 61.0.3163.100 (Official Build) (64-bit)

Steps to Reproduce

  1. Scaffold a new react application following the instructions found on the user guide.
  2. Serve index.html and all related artifacts in the ./build directory from my server.
  3. Navigate to localhost:8080. Observe that the "Welcome to React" page is displayed.
  4. Navigate to localhost:8080/idonotexist. Observe that the "Welcome to React" page is still displayed.

Expected Behavior

I expected the localhost:8080/idonotexist request to be handled by the server, rather than the service worker.

Actual Behavior

The service worker returns localhost:8080/idonotexist from the service worker. The page that is displayed is the default "Welcome to React" page.

image

Is this the desired behavior of the service worker? My understanding of service workers is limited, so I'm trying to determine if this is a bug or simply a gap in my knowledge.

Thanks for the great tool. Keep up the good work.

Brandon

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions