Polymer / polymer

Our original Web Component library.
https://polymer-library.polymer-project.org/
BSD 3-Clause "New" or "Revised" License
22.05k stars 2.01k forks source link

404 on ctrl-shift-r refresh of non-home page in starter kit #5664

Closed eatonphil closed 4 years ago

eatonphil commented 4 years ago

Description

Doing a hard-refresh of a non-home page view causes a 404 in the starter kit.

Live Demo

None.

Steps to Reproduce

  1. Create a new polymer-3-start-kit through polymer init
  2. Build the project with yarn build
  3. Start a server and navigate to the home page (cd build/es6-bundled && python3 -m http.server 9091 && open localhost:9091)
  4. Go to view 3 (http://localhost:9091/view3)
  5. Hard-refresh with ctrl-shift-r

Expected Results

A hard-refresh should load the page correctly. A hard-refresh on the home page (http://localhost:9091) loads successfully.

Actual Results

A hard-refresh always causes the non-home page view to 404. Even after a hard-refresh if you soft refresh the non-home page loads correctly.

Browsers Affected

Versions

The yarn.lock file is attached. yarn.lock.txt

jsilvermist commented 4 years ago

This is expected if using base Python HTTP server.

You need something to redirect requests to index.html. You might want to check out: https://www.npmjs.com/package/es-dev-server

eatonphil commented 4 years ago

That makes sense, thanks. The cached behavior threw me off.