Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem when importing firebase-messaging-sw to SW service worker. #193

Open
eeerrrttty opened this issue Jun 19, 2018 · 2 comments
Open

Comments

@eeerrrttty
Copy link

It's returning to me the following error in console:

Here is my configuration:

        new SWPrecacheWebpackPlugin({
            cacheId: 'teste',
            filename: 'service-worker.js',
            importScripts: ['./firebase-messaging-sw.js'],
            staticFileGlobs: ['dist/**/*.*'],
            minify: true,
            stripPrefix: 'dist/'
        })

Here is my firebase-messaging-sw.js:

import * as firebase from 'firebase'
require('firebase/firestore')

firebase.initializeApp({config})

const messaging = firebase.messaging()

Error during service worker registration:

TypeError: Failed to register a ServiceWorker: ServiceWorker script evaluation failed

@donaldboulton
Copy link

Me to, how to add?

@m16u31D
Copy link

m16u31D commented Jun 27, 2019

same problem, any solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants