Comments (7)
@ShafSpecs I had similar problem, check vite-pwa/vite-plugin-pwa#629
from monorepo.
Rename the js file to mjs (change the rollup input to the mjs file) before Vite build call, then rename it back to the original (don't forget to change also sourcemap file and reference in the js file): the problem is about using esbuild in Vite minify option (the default): check Vite issue vitejs/vite#15379 (comment)
You can try switching Vite minify option to terser (will require adding the dependency).
from monorepo.
What does your entry worker look like?
from monorepo.
The built service worker is meant to be a standalone js file, meaning no exports. But somehow, your entry.worker file gets built with export
still present
from monorepo.
The entry worker looks like this
https://gist.github.com/kayluhb/d2e1d0cac8b99d53af45339aa52972e2
from monorepo.
Thanks! Would try and replicate it here as well 👍
from monorepo.
@ShafSpecs I had similar problem, check vite-pwa/vite-plugin-pwa#629
@userquin Would building into mjs
format, then simply renaming to js
fix the export issue though? Or do I transform whilst renaming? Looking at his built worker, it's built in a completely different format for some reason:
var __getOwnPropNames = Object.getOwnPropertyNames;
var __commonJS = (cb, mod) => function __require() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var require_entry_worker = __commonJS({
// ...
});
export default require_entry_worker();
Instead of as a script
from monorepo.
Related Issues (20)
- Consider Remix v2 during `remix-pwa init` run HOT 6
- ESM Directory Import error with Remix 2 base template HOT 4
- Wrong conditionals used in compiler HOT 2
- Usage with Vite HOT 6
- sw: Asset cache in precache handler not initialised correctly HOT 3
- Getting started not working properly HOT 4
- Running `remix vite:dev` throws rollup plugin error HOT 1
- Trying to build project throws error on [vite-plugin-remix-pwa:virtual-entry-sw] HOT 5
- Cannot initialize app in v4 HOT 1
- Error and Failure in Creating entry.worker.ts during Remix PWA Upgrade HOT 5
- Incorrect sourmap on build due to plugin vite-plugin-remix-pwa:loader HOT 8
- Implementing push notifications HOT 4
- "@remix-pwa/push": "^1.0.2" is missing HOT 2
- how to setup Offline Page using remix-pwa HOT 3
- Server is crashing, no service worker being built, redeclaration of variable. HOT 1
- __workerManifest.assets is missing entry for manifest-{version}.js HOT 1
- Todo: Migrate to Biome
- Can't call `npx remix-pwa sw` HOT 4
- Question: remix-pwa inside electron HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from monorepo.