Closed dgastudio closed 2 years ago
@dgastudio what's the error on server?
Hola Joaquín! no errors at server side, new build is compiled successfully.
@dgastudio can you put here the js error and a screenshot of the pwa virtual module?
EDIT: search in
on source code => if you have a public repro it will be better
sure,
Console errors https://monosnap.com/file/Q2RK96F6XlHNPg3X5dLYtugpKRYsVF
@dgastudio try adding scope
and base
on pwa plugin and scope
on manifest entry:
VitePWA({
scope: '/',
base: '/',
manifest: {
scope: '/',
}
})
No, same error.
@dgastudio screenshot with the error on the promise expanded
@dgastudio the error is not the same, can you show the formatted code at that line on index.js? should have an if statement registering the service worker.
whole component https://pastebin.com/uYEDnfQQ
@dgastudio https://hkv3.frontend.local:3000
is local machine serving build or in dev? can you show the formatted code at that line on index.js?
index.js
import React from 'react'; import * as ReactDOM from 'react-dom'; import App from './App.jsx';
const container = document.getElementById('root');
// Create a root.
const root = ReactDOM.createRoot(container);
root.render(
https://hkv3.frontend.local:3000 is a dev
https://hkv3.build.local is a build
@dgastudio it seems the sw is being served with an incorrect mime type, just check the error: do you have a frontend behind the dev server?
@dgastudio feel free to open a new issue if the problem persists
Hey I would like to ask for your help
React 17: vite: latest vite-pwa: latest
app.jsx
in main component, App
First build, everything seems ok, service worker is up and running
But, on rebuild,
Uncaught (in promise) TypeError: Failed to update a ServiceWorker for scope () with script (/sw.js): A bad HTTP response code (500) was received when fetching the script.
Any advice, please? Thank you