facebook / facebook/docusaurus
Markdown links linking to JS files should resolve to the asset url, not transpiled code
- Vorherrschende Sprache
- TypeScript
- Sterne
- 66.2k
- Forks
- 10k
- Ø Merge
- 1 T. 3 Std.
- Gemergte PRs (30 T.)
- 52
Beschreibung
### 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.
- [ ] I have tried creating a repro with https://new.docusaurus.io.
- [x] I have read the console error message carefully (if applicable).
### Description
Something similar to https://github.com/facebook/docusaurus/issues/10460
### Reproducible demo
_No response_
### Steps to reproduce
This is simple to reproduce.
1. Create a fresh docusaurus site.
1. Create a file `static/assets/upload/test.js`:
```js
{
- / -sss;
}
```
2. Create a link in the documentation to this file
```markdown
---
sidebar_position: 6
---
# Congratulations!
[Test](/assets/upload/test.js)
```
This will break a build (rspack also).
It looks like https://github.com/facebook/docusaurus/issues/10460.
If the ‘invalid’ JavaScript is in the folder, but there is no reference to it, everything will build correctly.
### Expected behavior
Documentation is built even if there is a reference to an invalid JavaScript file in static assets.
### Actual behavior
```text
[ERROR] Client bundle compiled with errors therefore further build is impossible.
SyntaxError: /temp/docusaurus-rs-pack/my-website/static/assets/upload/test.js: Unterminated regular expression. (2:5)
1 | {
> 2 | - / -sss;
| ^
3 | }
4 |
at parser.next ()
at normalizeFile.next ()
at run.next ()
at transform.next ()
```
### Your environment
docusaurus 3.7.0
node 20.17.0
npm 10.8.2
### Self-service
- [ ] I'd be willing to fix this bug myself.
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.