I'm working on react Project which uses react-router as its routing Library.
since I want to run that project on a subdirectory of the website, I set the react-router basename attribute to 'my' in my app.js file.
App.js
<BrowserRouter basename={'/my'}>
and also I set the homepage property in the package.json file
package.json
"homepage": "/my",
the app works charming until I decided to make the app PWA using workBox.
craco.config.js Or Webpack.config.js
plugins: [
new InjectManifest({
swSrc: "./src/src-sw.js",
swDest: "sw.js",
}),
],
I tried to build and check if it's working, but it simply doesn't show me the any registered workers On the Application tab in the Chrome Developer Console
but as soon as I remove the basename attribute and homepage property, everything works, and the service worker and manifest.json files appear Application Tab