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

renderPageContent only works in production #487

Closed
krmax44 opened this issue Sep 30, 2019 · 0 comments · Fixed by #492
Closed

renderPageContent only works in production #487

krmax44 opened this issue Sep 30, 2019 · 0 comments · Fixed by #492

Comments

@krmax44
Copy link
Contributor

krmax44 commented Sep 30, 2019

Bug report

api.renderer.renderPageContent only works in production mode.

Steps to reproduce

Create a project with saber-plugin-search with the index option including content.

What is expected?

content should be set properly, as it is in production mode.

What is actually happening?

item.content = stripHTML(
await api.renderer.renderPageContent(page.permalink)
)

renderPageContent throws an error.

[error] TypeError: Cannot read property 'renderToString' of undefined
    at VueRenderer.renderPageContent (~/node_modules/saber/vue-renderer/lib/index.js:292:38)
    at Promise.all.map (~/node_modules/saber/packages/saber-plugin-search/lib/index.js:48:36)
    at Array.map (<anonymous>)
    at generateLocale (~/node_modules/saber/packages/saber-plugin-search/lib/index.js:31:31)
    at Promise.all.allLocalePaths.map.localePath (~/node_modules/saber/packages/saber-plugin-search/lib/index.js:67:40)
    at Array.map (<anonymous>)
    at generateDatabase (~/node_modules/saber/packages/saber-plugin-search/lib/index.js:67:22)
    at api.hooks.onCreatePages.tapPromise (~/node_modules/saber/packages/saber-plugin-search/lib/index.js:83:18)
    at tapInfo.fn.args (~/node_modules/saber/lib/index.js:88:20)
    at Promise (eval at create (~/node_modules/tapable/lib/HookCodeFactory.js:74:10), <anonymous>:46:17)
error Command failed with exit code 1.

Other relevant information

  • Result of running saber -v: latest
  • Browser version (optional):
  • Is Saber a global or local install? local
  • Which package manager did you use for the install? yarn
  • Does this issue occur when all plugins are disabled?
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.

1 participant