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 upgrading 4.2.0, it caused that generating html with hexo-pwa is failed #4044

Open
mystic-cg opened this issue Jan 1, 2020 · 4 comments
Open
Labels

Comments

@mystic-cg
Copy link

@mystic-cg mystic-cg commented Jan 1, 2020

Check List

Please check followings before submitting a new issue.

  • I have already read Docs page & Troubleshooting page
  • I have already searched existing issues and they are not help to me
  • I examined error or warning messages and it's difficult to solve
  • Using the latest version of Hexo (run hexo version to check)
  • Node.js is higher than 8.6.0

Expected behavior

hexo g is successful.

Actual behavior

hexo g is failed.

How to reproduce?

Using hexo-pwa plugin, then hexo g

Environment & Settings

Node.js & npm version

$ node -v
v13.3.0

$ npm -v
6.13.4

$ yarn -v
1.19.2

Hexo and Plugin version(npm ls --depth 0)

    "hexo": "4.2.0",
    "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.2.0",
    "hexo-generator-sitemap": "^2.0.0",
    "hexo-generator-tag": "^1.0.0",
    "hexo-helper-live2d": "^3.1.1",
    "hexo-pwa": "^0.1.3",
    "hexo-renderer-ejs": "^1.0.0",
    "hexo-renderer-marked": "^2.0.0",
    "hexo-renderer-stylus": "^1.1.0",
    "hexo-server": "^1.0.0",
    "live2d-widget-model-koharu": "^1.0.5",
    "live2d-widget-model-z16": "^1.0.5",
    "npm-check-updates": "^4.0.1"

Others

FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
TypeError: Cannot read property 'data' of undefined
    at Hexo.module.exports (C:\Users\purpl\Desktop\caoyu.info\cc\node_modules\hexo-pwa\lib\serviceWorker.js:23:39)
    at Hexo.tryCatcher (C:\Users\purpl\Desktop\caoyu.info\cc\node_modules\bluebird\js\release\util.js:16:23)
    at Hexo.<anonymous> (C:\Users\purpl\Desktop\caoyu.info\cc\node_modules\bluebird\js\release\method.js:15:34)
    at C:\Users\purpl\Desktop\caoyu.info\cc\node_modules\hexo\lib\hexo\index.js:390:22
    at tryCatcher (C:\Users\purpl\Desktop\caoyu.info\cc\node_modules\bluebird\js\release\util.js:16:23)
    at MappingPromiseArray._promiseFulfilled (C:\Users\purpl\Desktop\caoyu.info\cc\node_modules\bluebird\js\release\ma
p.js:68:38)
    at MappingPromiseArray.PromiseArray._iterate (C:\Users\purpl\Desktop\caoyu.info\cc\node_modules\bluebird\js\releas
e\promise_array.js:115:31)
    at MappingPromiseArray.init (C:\Users\purpl\Desktop\caoyu.info\cc\node_modules\bluebird\js\release\promise_array.j
s:79:10)
    at MappingPromiseArray._asyncInit (C:\Users\purpl\Desktop\caoyu.info\cc\node_modules\bluebird\js\release\map.js:37
:10)
    at _drainQueueStep (C:\Users\purpl\Desktop\caoyu.info\cc\node_modules\bluebird\js\release\async.js:97:12)
    at _drainQueue (C:\Users\purpl\Desktop\caoyu.info\cc\node_modules\bluebird\js\release\async.js:86:9)
    at Async._drainQueues (C:\Users\purpl\Desktop\caoyu.info\cc\node_modules\bluebird\js\release\async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (C:\Users\purpl\Desktop\caoyu.info\cc\node_modules\bluebird\js\re
lease\async.js:15:14)
    at processImmediate (internal/timers.js:444:21)

image

@mystic-cg

This comment has been minimized.

Copy link
Author

@mystic-cg mystic-cg commented Jan 1, 2020

After downgrading to 4.1.1, it works fine.

@mystic-cg

This comment has been minimized.

Copy link
Author

@mystic-cg mystic-cg commented Jan 1, 2020

It could be caused by lodash, hexo-pwa is using lodash.

@SukkaW

This comment has been minimized.

Copy link
Member

@SukkaW SukkaW commented Jan 1, 2020

@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

@mystic-cg

This comment has been minimized.

Copy link
Author

@mystic-cg mystic-cg commented Jan 2, 2020

I have registered the new issue.
lavas-project/hexo-pwa#15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.