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

Cannot read properties of undefined (reading 'replace') at formatPluginName #10228

Closed
2 of 7 tasks
Aoyimiyak opened this issue Jun 18, 2024 · 8 comments
Closed
2 of 7 tasks
Labels
bug An error in the Docusaurus core causing instability or issues with its execution closed: can't repro This bug is because of some local setup that can't be reproduced.

Comments

@Aoyimiyak
Copy link

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

I report this error when I start the project
微信截图_20240618120159

Reproducible demo

No response

Steps to reproduce

I updated the version to 3.4.0 and then started the project, and the terminal reported this error

Expected behavior

The project can be started normally

Actual behavior

1

Your environment

  • Public source code:
  • Public site URL:
  • Docusaurus version used:
  • Environment name and version (e.g. Chrome 89, Node.js 16.4):
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS):

Self-service

  • I'd be willing to fix this bug myself.
@Aoyimiyak Aoyimiyak 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 Jun 18, 2024
@OzakIOne
Copy link
Contributor

Can you create a minimal repro ? There shouldn't be any issue upgrading docusaurus version, this might come from your setup

@slorber
Copy link
Collaborator

slorber commented Jun 18, 2024

Please try again, this might be a temporary issue we had recently.

Until a runnable repro is provided (using https://docusaurus.new/stackblitz or GitHub), I'm going to close

@slorber slorber closed this as not planned Won't fix, can't repro, duplicate, stale Jun 18, 2024
@slorber slorber added closed: can't repro This bug is because of some local setup that can't be reproduced. and removed status: needs triage This issue has not been triaged by maintainers labels Jun 18, 2024
@htmlin
Copy link

htmlin commented Jul 4, 2024

I've written a custom plugin that returns null under certain circumstances, and that's causing this issue. I hope this is helpful for you.

@slorber
Copy link
Collaborator

slorber commented Jul 9, 2024

I've written a custom plugin that returns null under certain circumstances, and that's causing this issue. I hope this is helpful for you.

Curious to know more about this use-case

Maybe we could allow that

@slorber
Copy link
Collaborator

slorber commented Jul 9, 2024

Forgot to mention but this original issue is related to #10239

We need plugins to have a name

But we could also allow a plugin to return null eventually, as a convenient way to self-disable depending on options 🤷‍♂️ can you explain that need @htmlin ?

Even if we allow this, this would only be a "shortcut" because you could also decide from the config file to filter out the plugin from the plugins array depending on context.

@slorber
Copy link
Collaborator

slorber commented Jul 9, 2024

Note that we even have a use-case for this internally:
https://github.com/facebook/docusaurus/blob/main/packages/docusaurus-plugin-sitemap/src/index.ts#L21

So let's add the ability to return null!

@htmlin
Copy link

htmlin commented Jul 9, 2024

Forgot to mention but this original issue is related to #10239

We need plugins to have a name

But we could also allow a plugin to return null eventually, as a convenient way to self-disable depending on options 🤷‍♂️ can you explain that need @htmlin ?

Even if we allow this, this would only be a "shortcut" because you could also decide from the config file to filter out the plugin from the plugins array depending on context.

If I return a null value in the custom plugin, Docusaurus throws this error. So now, I’ve moved the condition check to the plugins configuration to bypass this issue.

@slorber
Copy link
Collaborator

slorber commented Jul 9, 2024

This will be supported soon (v3.5)

PR: #10286

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution closed: can't repro This bug is because of some local setup that can't be reproduced.
Projects
None yet
Development

No branches or pull requests

4 participants