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 in OfflinePlugin: Something went wrong with ServiceWorker entry #10

Closed
mediabakery opened this issue Oct 21, 2015 · 8 comments
Closed
Labels

Comments

@mediabakery
Copy link

I tried to use your offline-plugin, but I got an error message. Can you help me please?
The only hint is: ERROR in OfflinePlugin: Something went wrong with ServiceWorker entry

The plugin produces some files

  • appcache/*
  • __offline_serviceworker.0317e3e194f425aca189

This is my config file: https://gist.github.com/anonymous/9a95e4ebeb7f1868e03b

I would be very grateful if you can give me a hint on what I'm doing wrong.

@NekR
Copy link
Owner

NekR commented Oct 21, 2015

@mediabakery thanks for reporting this!

Issue happens here https://github.com/NekR/offline-plugin/blob/master/src/service-worker.js#L53 because I do exact check for __offline_serviceworker few lines above, but it of course does not works since you are using hash in chunks. There probably should be a better way to produce fake entries, or I may not need them at all.

Anyway, I will have a fix today.

@NekR
Copy link
Owner

NekR commented Oct 21, 2015

Btw, in your case, do you want ServiceWorker output file to have hash in its name?

@mediabakery
Copy link
Author

@NekR Thanks! Yes you are right. I don't need to hash the serviceWorker file name.

NekR added a commit that referenced this issue Oct 21, 2015
Use `compilation.namedChunks` instead of `compilation.assets` to pick
corrent entry and then `chunk.files` to pick correct output file from
`compilation.assets`

Refs #10
@NekR NekR added the bug label Oct 21, 2015
@NekR
Copy link
Owner

NekR commented Oct 21, 2015

@mediabakery I just pushed the fix, it works for me, but can you try it before I publish it to npm?

To test latest update, install offline-plugin directly from GitHub repo:
npm install https://github.com/NekR/offline-plugin

@mediabakery
Copy link
Author

@NekR Thanks! I'll test it as soon as possible!

@mediabakery
Copy link
Author

Hey @NekR. It works for me as expected. Thanks!

@NekR
Copy link
Owner

NekR commented Oct 22, 2015

Great, thanks for reporting this one!

@NekR NekR closed this as completed Oct 22, 2015
@NekR
Copy link
Owner

NekR commented Oct 22, 2015

Published on npm

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

No branches or pull requests

2 participants