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

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

Open
pplmx opened this issue Jan 2, 2020 · 8 comments
Open

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

pplmx opened this issue Jan 2, 2020 · 8 comments

Comments

@pplmx
Copy link

pplmx commented Jan 2, 2020

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
hexojs/hexo#4044

@marcofranssen
Copy link
Contributor

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
Copy link

8su commented Mar 11, 2020

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)

hexojs/hexo#4044 (comment)

@pplmx
Copy link
Author

pplmx commented Mar 25, 2020

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

@marcofranssen
Copy link
Contributor

@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
Copy link

Can this please get merged

@puremana
Copy link

@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
Copy link
Contributor

@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
Copy link
Author

pplmx commented Jul 15, 2020

  • if your theme is next, maybe you can use hexo-next-pwa
  • if you wanna continue use this repo personally, you can fork it and config like as follows:
    "hexo-pwa": "git+https://github.com/<github-name>/hexo-pwa.git",
{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "build": "hexo generate",
    "clean": "hexo clean",
    "deploy": "hexo deploy",
    "server": "hexo server"
  },
  "hexo": {
    "version": "4.2.1"
  },
  "dependencies": {
    "hexo": "4.2.1",
    "hexo-baidu-url-submit": "0.0.6",
    "hexo-deployer-git": "^2.1.0",
    "hexo-generator-archive": "^1.0.0",
    "hexo-generator-baidu-sitemap": "^0.1.6",
    "hexo-generator-category": "^1.0.0",
    "hexo-generator-feed": "^2.2.0",
    "hexo-generator-index": "^1.0.0",
    "hexo-generator-searchdb": "^1.3.1",
    "hexo-generator-sitemap": "^2.0.0",
    "hexo-generator-tag": "^1.0.0",
    "hexo-helper-live2d": "^3.1.1",
    "hexo-pwa": "git+https://github.com/mystic-cg/hexo-pwa.git",
    "hexo-renderer-ejs": "^1.0.0",
    "hexo-renderer-marked": "^3.0.0",
    "hexo-renderer-stylus": "^1.1.0",
    "hexo-server": "^1.0.0",
    "hexo-symbols-count-time": "^0.7.1",
    "live2d-widget-model-koharu": "^1.0.5",
    "live2d-widget-model-z16": "^1.0.5",
    "npm-check-updates": "^7.0.1"
  }
}

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

Successfully merging a pull request may close this issue.

4 participants