question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Generated service worker uses file paths under Windows 10

See original GitHub issue

Can you reproduce the problem with latest npm?

Yes, I upgraded to the npm version 4.6.1 and the proble is reproducible

Description

Under windows, in a brand new project created with create-react-app, the service worker uses the location on disk of the files to be cached in its cache configuration.

Expected behavior

The service worker uses the proper URLs for caching configuration

Environment

react-scripts@1.0.0 node v6.10.1 npm 4.6.1

Windows 10 Any browser (not a browser issue)

Reproducible Demo

Create a brand new app with create-react-app in the environment above, run npm run build, and check the contents of service-worker.js. It contains file paths, such as

var precacheConfig = [
  ["C:/dev/temp/pwatest/build/index.html", "df24d8c1abce89d06bc00d2023cdad0c"],
  [
    "C:/dev/temp/pwatest/build/static/css/main.9a0fe4f1.css",
    "3473922d6aed4c20bb69846d6027cacf"
  ],
  [
    "C:/dev/temp/pwatest/build/static/js/main.23e5d2a8.js",
    "d0f59b7dffbc3ff4835b038c8f3a4fdc"
  ],
  [
    "C:/dev/temp/pwatest/build/static/media/logo.5d5d9eef.svg",
    "5d5d9eefa31e5e13a6610d9fa7a283bb"
  ]
]

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:20 (19 by maintainers)

github_iconTop GitHub Comments

2reactions
jorispzcommented, May 19, 2017

Tested and I can confirm it works for me.

Thanks to all involved, this is an impressive turnaround time!

1reaction
goldhandcommented, May 19, 2017

@jeffposnick I’ve heard that setting stripPrefix: path.join(__dirname, 'dist').replace(/\\/g,"/") works for windows uses (as a temporary windows solution). I am looking into a fix that will work on windows without configuration.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create a Customizable FileSystemWatcher Windows Service
This class is able to detect events in the file system, such as create, modify, or delete files and folders; it's fully customizable;...
Read more >
Host ASP.NET Core in a Windows Service | Microsoft Learn
Use the Worker Service ( worker ) template with the dotnet new command from a command shell. In the following example, a Worker...
Read more >
Create a Windows Service using BackgroundService - .NET
To create a new Worker Service project with Visual Studio, you'd select File > New > Project.... From the Create a new project...
Read more >
File path formats on Windows systems | Microsoft Learn
In this article, learn about file path formats on Windows systems, such as traditional DOS paths, DOS device paths, and universal naming ...
Read more >
Tutorial: Create a Windows service app - .NET Framework
This article demonstrates how to create a Windows service app in Visual Studio that writes messages to an event log.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found