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

Error: ENOENT: no such file or directory, open workbox-v3.6.3/workbox-sw #1

Closed
zanjs opened this issue Mar 16, 2019 · 2 comments
Closed

Comments

@zanjs
Copy link

zanjs commented Mar 16, 2019

Error: ENOENT: no such file or directory, open workbox-v3.6.3/workbox-sw
@lvzhenbang
Copy link
Owner

lvzhenbang commented Mar 22, 2019

I'm sorry I couldn't get back in time.

Fisrt, you need to find ‘build/webpack.config.js’。

then,

fix:
// new Workbox.GenerateSW({ // clientsClaim: true, // skipWaiting: true, // importWorkboxFrom: 'local' // }), new Workbox.InjectManifest({ // importWorkboxFrom: 'local', importsDirectory: path.join(__dirname, '../dist'), swSrc: path.resolve(__dirname, '../dist/workbox-v3.6.3/workbox-sw.js'), swDest: path.resolve(__dirname, '../dist/service-worker.js') })

to:
new Workbox.GenerateSW({ clientsClaim: true, skipWaiting: true, importWorkboxFrom: 'local' }), // new Workbox.InjectManifest({ // // importWorkboxFrom: 'local', // importsDirectory: path.join(__dirname, '../dist'), // swSrc: path.resolve(__dirname, '../dist/workbox-v3.6.3/workbox-sw.js'), // swDest: path.resolve(__dirname, '../dist/service-worker.js') // })
Note: If you use Workbox.GenerateSW, it creates a problem that the network cannot access. So the best way is to localize ' workbox-sw '. But it can only pass through Workbox.InjectManifest realize.

you can visit issue.

@zanjs
Copy link
Author

zanjs commented Mar 22, 2019

thanks

@zanjs zanjs closed this as completed Mar 22, 2019
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

2 participants