lavas-project / hexo-pwa

Hexo PWA plugin
MIT License
133 stars 17 forks source link

After hexo upgrading 4.2.0, hexo-pwa fails to generate html. #15

Open pplmx opened 4 years ago

pplmx commented 4 years ago

The root cause is that

@mystic-cg

Locals.cache should only be considered as an Internal private API. After c6e6e6b#diff-8706ed85bcc456bc4bd99698f3cb949dR7 the Locals.cache is now Locals.cache.cache.

According to Hexo API's documents, there is already a method called Locals.toObject(). The developer should always using public API for consistency. Please open an issue at hexo-pwa and asking them for using Locals.toObject() instead of Locals.cache.

Related issue: tea3/hexo-related-popular-posts#23

After upgrading 4.2.0, it caused that generating html with hexo-pwa is failed #4044 https://github.com/hexojs/hexo/issues/4044

marcofranssen commented 4 years ago

Same here..., Anyone knows what and how to fix?

See below the exact error stacktrace if that helps

TypeError: Cannot read property 'data' of undefined
    at Hexo.module.exports (/Users/marco/code/my_blog/node_modules/hexo-pwa/lib/serviceWorker.js:23:39)
    at Hexo.tryCatcher (/Users/marco/code/my_blog/node_modules/hexo/node_modules/bluebird/js/release/util.js:16:23)
    at Hexo.<anonymous> (/Users/marco/code/my_blog/node_modules/hexo/node_modules/bluebird/js/release/method.js:15:34)
    at /Users/marco/code/my_blog/node_modules/hexo/lib/hexo/index.js:390:22
    at tryCatcher (/Users/marco/code/my_blog/node_modules/hexo/node_modules/bluebird/js/release/util.js:16:23)
    at MappingPromiseArray._promiseFulfilled (/Users/marco/code/my_blog/node_modules/hexo/node_modules/bluebird/js/release/map.js:68:38)
    at MappingPromiseArray.PromiseArray._iterate (/Users/marco/code/my_blog/node_modules/hexo/node_modules/bluebird/js/release/promise_array.js:115:31)
    at MappingPromiseArray.init (/Users/marco/code/my_blog/node_modules/hexo/node_modules/bluebird/js/release/promise_array.js:79:10)
    at MappingPromiseArray._asyncInit (/Users/marco/code/my_blog/node_modules/hexo/node_modules/bluebird/js/release/map.js:37:10)
    at _drainQueueStep (/Users/marco/code/my_blog/node_modules/hexo/node_modules/bluebird/js/release/async.js:97:12)
    at _drainQueue (/Users/marco/code/my_blog/node_modules/hexo/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/Users/marco/code/my_blog/node_modules/hexo/node_modules/bluebird/js/release/async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/Users/marco/code/my_blog/node_modules/hexo/node_modules/bluebird/js/release/async.js:15:14)
    at processImmediate (internal/timers.js:456:21)
8su commented 4 years ago

Same here..., Anyone knows what and how to fix?

See below the exact error stacktrace if that helps

TypeError: Cannot read property 'data' of undefined
    at Hexo.module.exports (/Users/marco/code/my_blog/node_modules/hexo-pwa/lib/serviceWorker.js:23:39)
    at Hexo.tryCatcher (/Users/marco/code/my_blog/node_modules/hexo/node_modules/bluebird/js/release/util.js:16:23)
    at Hexo.<anonymous> (/Users/marco/code/my_blog/node_modules/hexo/node_modules/bluebird/js/release/method.js:15:34)
    at /Users/marco/code/my_blog/node_modules/hexo/lib/hexo/index.js:390:22
    at tryCatcher (/Users/marco/code/my_blog/node_modules/hexo/node_modules/bluebird/js/release/util.js:16:23)
    at MappingPromiseArray._promiseFulfilled (/Users/marco/code/my_blog/node_modules/hexo/node_modules/bluebird/js/release/map.js:68:38)
    at MappingPromiseArray.PromiseArray._iterate (/Users/marco/code/my_blog/node_modules/hexo/node_modules/bluebird/js/release/promise_array.js:115:31)
    at MappingPromiseArray.init (/Users/marco/code/my_blog/node_modules/hexo/node_modules/bluebird/js/release/promise_array.js:79:10)
    at MappingPromiseArray._asyncInit (/Users/marco/code/my_blog/node_modules/hexo/node_modules/bluebird/js/release/map.js:37:10)
    at _drainQueueStep (/Users/marco/code/my_blog/node_modules/hexo/node_modules/bluebird/js/release/async.js:97:12)
    at _drainQueue (/Users/marco/code/my_blog/node_modules/hexo/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/Users/marco/code/my_blog/node_modules/hexo/node_modules/bluebird/js/release/async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/Users/marco/code/my_blog/node_modules/hexo/node_modules/bluebird/js/release/async.js:15:14)
    at processImmediate (internal/timers.js:456:21)

https://github.com/hexojs/hexo/issues/4044#issuecomment-592927004

pplmx commented 4 years ago

@marcofranssen when would your team plan to release a new version to npm repo?

marcofranssen commented 4 years ago

@mystic-cg it is not my team, just forked it to resolve for myself some bugs as it is not actively maintained. Will contribute my fixes anyhow, but releases I can't control.

puremana commented 4 years ago

Can this please get merged

puremana commented 4 years ago

@marcofranssen Is there any chance you would be able to publish your fork on NPM? Or is this not something you would be interested in? If the latter, I will replace hexo pwa with an alternative. Thank you for your work regardless 😃

marcofranssen commented 4 years ago

@puremana I could have a look if that is possible, but I think I will have to publish under a different name. Not sure at what timeframe I would have time for that though.

pplmx commented 4 years ago