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

Service worker breaks direct link to static assets in public folder #3664

Closed
James2516 opened this issue Dec 31, 2017 · 4 comments
Closed

Service worker breaks direct link to static assets in public folder #3664

James2516 opened this issue Dec 31, 2017 · 4 comments

Comments

@James2516
Copy link

James2516 commented Dec 31, 2017

Is this a bug report?

Yes

Can you also reproduce the problem with npm 4.x?

Yes

Which terms did you search for in User Guide?

service worker

Environment

  1. node -v: v8.6.0
  2. npm -v:
  3. yarn --version (if you use Yarn): 1.3.2
  4. npm ls react-scripts (if you haven’t ejected): react-scripts@1.0.17

Then, specify:

  1. Operating system: Mac
  2. Browser and version (if relevant): Chrome v63

Steps to Reproduce

https://redirect.netlify.com/
The first link works, but not the second. Why?

import React from "react";

const App = () => (
  <div>
    <p>
      <a href="http://redirect.netlify.com/manifest.json">
        http://redirect.netlify.com/manifest.json
      </a>
    </p>
    <p>
      <a href="https://redirect.netlify.com/manifest.json">
        https://redirect.netlify.com/manifest.json
      </a>
    </p>
  </div>
);

export default App;

Service worker code: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/src/registerServiceWorker.js

@henninghall
Copy link

henninghall commented Jan 4, 2018

I guess the http link works because "Service workers require HTTPS"

I had this issue and solved it by disabling service workers and clearing browser cache. But there must be a better way if one wants to use service workers right?

@gaearon
Copy link
Contributor

gaearon commented Jan 9, 2018

cc @jeffposnick

@jeffposnick
Copy link
Contributor

This is another one that could be duped against #3248 (or #3008).

The change in #3419, if we moved ahead with that, would address it.

@gaearon
Copy link
Contributor

gaearon commented Jan 10, 2018

Fixed via #3419.

@gaearon gaearon closed this as completed Jan 10, 2018
@lock lock bot locked and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants