facebook / facebook/docusaurus

Plugins API: `beforeDevServer` and `afterDevServer` are documented, but don't exist

Open
#9,655 3 comments 0 reactions 0 assignees View on GitHub
bug status: needs triage
Dominant language
TypeScript
Stars
66.2k
Forks
10k
Avg merge
1d 3h
Merged PRs (30d)
52

Description

### Have you read the Contributing Guidelines on issues?

- [X] I have read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#issues).

### Prerequisites

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

### Description

https://docusaurus.io/docs/api/plugin-methods mentions `beforeDevServer` and `afterDevServer`. When I attempted to use these, I found I couldn't get them to do anything. A [quick search in GitHub](https://github.com/search?q=repo%3Afacebook%2Fdocusaurus+beforeDevServer&type=code) shows only results in `.mdx` files, so it appears to me like the API simply doesn't exist. [Searching for configureWebpack instead](https://github.com/search?q=repo%3Afacebook%2Fdocusaurus+configureWebpack&type=code), for example, brings up a bunch of results.

### Reproducible demo

https://codesandbox.io/p/devbox/examples-classic-b9y9z?file=%2Fdocusaurus.config.js

### Steps to reproduce

1. Run the dev server
2. Observe that `running beforeDevServer` isn't logged

### Expected behavior

I don't really know because it's completely broken, but I'd expect it to at least console.log when starting the dev server, like it does if I configure the plugin manually using `configureWebpack`.

### Actual behavior

Nothing is logged. I get no behaviour change.

### Your environment

_No response_

### Self-service

- [ ] I'd be willing to fix this bug myself.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.