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

Docusaurus Node/SSR could not render static page with path /blog/tags/JavaScript because of following error #6608

Closed
6 of 7 tasks
JiuRanYa opened this issue Feb 5, 2022 · 2 comments
Labels
closed: question This issue is a user error/misunderstanding.

Comments

@JiuRanYa
Copy link
Contributor

JiuRanYa commented Feb 5, 2022

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

It's normal when I use npm run start, but some errors occurred when I use 'npm run build':

Error here:

[ERROR] Docusaurus Node/SSR could not render static page with path /blog/tags/前端 because of following error:
ReferenceError: theme is not defined

Steps to reproduce

clone project from 'https://github.com/1084350607/blog'

  1. npm run build

Expected behavior

build normally

Actual behavior

build error

Your environment

Reproducible demo

No response

Self-service

  • I'd be willing to fix this bug myself.
@JiuRanYa JiuRanYa added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Feb 5, 2022
@Josh-Cena Josh-Cena added closed: question This issue is a user error/misunderstanding. and removed bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Feb 5, 2022
@Josh-Cena
Copy link
Collaborator

Your swizzled component contains a bad line: https://github.com/1084350607/blog/blob/main/src/theme/BlogPostItem/index.tsx#L85

You deliberately ts-ignored it, hence the silent error 😅 Replace that with const { isDarkTheme } = useColorMode(): https://docusaurus.io/docs/next/api/themes/configuration#use-color-mode

Please don't use the GitHub issue tracker as a support forum. It's very distracting and pollutes our repo history. Prefer any of our support channels (I'm always around on Discord)

@JiuRanYa
Copy link
Contributor Author

JiuRanYa commented Feb 5, 2022

Thanks so much!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: question This issue is a user error/misunderstanding.
Projects
None yet
Development

No branches or pull requests

2 participants