yyx990803 / register-service-worker

A script to simplify service worker registration with hooks for common events.
MIT License
639 stars 58 forks source link

Error on trying to run SSR #13

Closed chenxeed closed 6 years ago

chenxeed commented 6 years ago

Hello, I'm trying out the SSR example project made by @eddyerburgh from here: https://github.com/eddyerburgh/vue-cli-ssr-example

When I tried to run the build to run production server, it shows me this:

screen shot 2018-09-01 at 5 13 27 pm

Any clue what went wrong? Thank you! @yyx990803

chenxeed commented 6 years ago

Ah, turns out this error is from importing ./register-service-worker, which was added by default on vue-cli 3 main.js file. While the example project here doesn't call that module.

eddyerburgh commented 6 years ago

Hi @chenxeed, can you please open this issue in the vue-cli-ssr-example repo, instead of here.

chenxeed commented 6 years ago

Hi @eddyerburgh sorry for the misplacement. I was thinking to put it here because in your example you're not using registerServiceWorker from the latest vue-cli 3, so I thought of asking it here since the library is the one causing the error.

I've fixed this issue by move the import script of registerServiceWorker.js to entry-client instead.