Comments (6)
That's a good point. Do you have an example of error that hang the compilation?
from serviceworker-webpack-plugin.
https://github.com/oliviertassinari/serviceworker-webpack-plugin/blob/master/docs/src/sw.js
If you just introduce a syntax error, say:
let assetsToCache = [
...assets,
'fasd'
'./',
];
Also, if the project is setup with eslint, it would nice to apply the same.
Thanks for the work :)
from serviceworker-webpack-plugin.
@anilshanbhag I have tried your example, here is what I have from webpack@2. It doesn't hang on my side. I'm closing until another reproduction test case is provided.
ERROR in ./docs/src/sw.js
Module build failed: SyntaxError: Unexpected token, expected , (20:2)
18 | ...assets,
19 | 'fasd'
> 20 | './',
| ^
21 | ];
22 |
23 | assetsToCache = assetsToCache.map((path) => {
from serviceworker-webpack-plugin.
@oliviertassinari I am using it with Vue. I tried the example in docs and that does print out errors from service worker. However, when i use it with vue templates it doesn't (atleast it doesn't hang now). Steps to reproduce:
- Follow instructions here to create a dummy vue project: https://github.com/vuejs-templates/webpack.
- Include the service worker plugin in package.json. Add a simple sw.js in src/ folder. Register plugin in `build/webpack.dev.conf
new ServiceWorkerWebpackPlugin({
entry: path.join(__dirname, '../src/sw.js'),
excludes: [
'**/.*',
'**/*.map',
'*.html',
],
}),
I have been using the plugin for a while and making sure the service worker compiles at each step. However just happened to code for an hour and now I have been debugging for nearly an hour trying to isolate where the js error is :/ Would be of great help if the plugin reported errors like it does in the example.
from serviceworker-webpack-plugin.
Thanks for the reproduction example. I don't have time to look into it but I'm reopening so someone could.
from serviceworker-webpack-plugin.
This seems related to #29
from serviceworker-webpack-plugin.
Related Issues (20)
- ServiceWorker script evaluation failed
- DOMException error
- Feature: pass arbitrary data to serviceworker
- Don't detect minification using webpack.optimize HOT 5
- Is there a way to add babel-polyfill using options ? HOT 6
- Serious issues with sourcemaps and multiple webpack configs. HOT 2
- Unexpected using UglifyJSPlugin in development mode HOT 3
- webpack 4 support HOT 3
- The script has an unsupported MIME type ('text/html') HOT 7
- postinstall script requires yarn HOT 1
- import runtime from 'serviceworker-webpack-plugin/lib/runtime'; always throws error HOT 1
- Cannot get the plugin to load the sw.js file inside dist folder HOT 1
- Easy way to disable plugin HOT 1
- Specify absolute path HOT 2
- Eslint dont produce explanation about errors
- Minimizing errors with UglisyJsPlugin HOT 1
- Webpack bootstrap code in sw.js file
- getRegistration
- it doesn't work with nuxt
- typescript definitions
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 serviceworker-webpack-plugin.