Repository navigation
Closed
Description
🐛 Bug Report
Prerequisites
- I'm using the latest version of Docusaurus.
- I have tried the
npm run clearoryarn clearcommand. - I have tried
rm -rf node_modules yarn.lock package-lock.jsonand 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
Just created a new docusaurus installation following the getting started guide
Have you read the Contributing Guidelines on issues?
yep
Steps to reproduce
npx @docusaurus/init@latest init my-website classiccd my-website && npm run start
Expected behavior
Expect build to succeed and the template docs to open up.
Actual behavior
The following error occurs when the build fails:
Starting the development server...
Docusaurus website is running at "http://localhost:3000/".
● Client █████████████████████████ building (10%) 0/5 entries 374/434 dependencies 80/166 modules 84 active
node_modules/call-bind/index.js
● Client █████████████████████████ building (10%) 0/5 entries 389/500 dependencies 83/169 modules 81 active
node_modules/call-bind/index.js
● Client █████████████████████████ building (10%) 0/5 entries 443/530 dependencies 83/184 modules 82 active
node_modules/define-properties/index.js
● Client █████████████████████████ building (11%) 0/5 entries 498/573 dependencies 95/199 modules 88 active babel-loader › node_modules/@docusaurus/theme-classic/lib-next/theme/BlogPostItem/index.js● Client █████████████████████████ building (11%) 0/5 entries 603/673 dependencies 107/222 modules 103 active node_modules/get-intrinsic/index.js● Client █████████████████████████ building (11%) 0/5 entries 634/673 dependencies 108/230 modules 115 active static/img/undraw_docusaurus_mountain.svg● Client █████████████████████████ building (11%) 0/5 entries 686/727 dependencies 109/253 modules 122 active url-loader › static/img/docusaurus.png● Client █████████████████████████ building (11%) 0/5 entries 690/729 dependencies 109/255 modules 124 active babel-loader › node_modules/@docusaurus/theme-common/lib/utils/useThemeConfig.js● Client █████████████████████████ building (11%) 0/5 entries 696/759 dependencies 136/257 modules 120 active babel-loader › node_modules/@docusaurus/plugin-content-docs/lib/theme/hooks/useDocs.js● Client █████████████████████████ building (11%) 0/5 entries 739/765 dependencies 150/266 modules 111 active babel-loader › node_modules/@docusaurus/utils-common/lib/index.js● Client █████████████████████████ building (11%) 0/5 entries 753/781 dependencies 152/272 modules 116 active babel-loader › node_modules/@docusaurus/theme-classic/lib-next/theme/Logo/index.js● Client █████████████████████████ building (11%) 0/5 entries 756/793 dependencies 153/272 modules 116 active babel-loader › node_modules/@docusaurus/theme-classic/lib-next/theme/DocSidebarItem/index.js● Client █████████████████████████ building (11%) 0/5 entries 773/800 dependencies 160/280 modules 117 active node_modules/react-json-view/dist/main.js● Client █████████████████████████ building (11%) 0/5 entries 791/808 dependencies 160/286 modules 121 active babel-loader › node_modules/@docusaurus/utils-common/lib/applyTrailingSlash.js● Client █████████████████████████ building (11%) 0/5 entries 795/833 dependencies 160/289 modules 124 active babel-loader › node_modules/@docusaurus/theme-classic/lib-next/theme/IconEdit/index.js● Client █████████████████████████ building (11%) 0/5 entries 813/839 dependencies 164/289 modules 123 active css-loader › postcss-loader › node_modules/@docusaurus/theme-classic/lib-next/theme/DocSidebarItem/styles.module.css● Client █████████████████████████ building (11%) 0/5 entries 824/852 dependencies 172/295 modules 121 active css-loader › postcss-loader › node_modules/docusaurus-theme-redoc/dist/custom.css|0● Client █████████████████████████ building (11%) 0/5 entries 845/859 dependencies 177/303 modules 126 active babel-loader › node_modules/@docusaurus/theme-classic/lib-next/theme/SearchMetadatas/index.js● Client █████████████████████████ building (11%) 0/5 entries 850/878 dependencies 177/305 modules 127 active css-loader › postcss-loader › node_modules/@docusaurus/theme-classic/lib-next/theme/ThemedImage/styles.module.css● Client █████████████████████████ building (12%) 0/5 entries 864/888 dependencies 183/309 modules 124 active css-loader › postcss-loader › node_modules/@docusaurus/theme-classic/lib-next/theme/Toggle/styles.css● Client █████████████████████████ building (12%) 0/5 entries 875/893 dependencies 183/313 modules 129 active babel-loader › node_modules/@docusaurus/core/lib/client/exports/Noop.js● Client █████████████████████████ building (43%) 3/5 entries 889/899 dependencies 209/323 modules 111 active babel-loader › node_modules/@docusaurus/theme-classic/lib-next/theme/NavbarItem/DefaultNavbarItem.js● Client █████████████████████████ building (43%) 3/5 entries 943/990 dependencies 210/365 modules 111 active node_modules/mini-css-extract-plugin/dist/hmr/normalize-url.js● Client █████████████████████████ building (42%) 3/5 entries 965/997 dependencies 218/370 modules 134 active node_modules/@babel/runtime/helpers/createForOfIteratorHelper.js● Client █████████████████████████ building (43%) 3/5 entries 987/1024 dependencies 244/370 modules 111 active node_modules/@babel/runtime/helpers/inherits.js● Client █████████████████████████ building (42%) 3/5 entries 1023/1064 dependencies 268/378 modules 104 active node_modules/@redocly/openapi-core/lib/bundle.js● Client █████████████████████████ building (43%) 3/5 entries 1054/1104 dependencies 284/390 modules 105 active ignored|/Users/bharat/Documents/Projects/Dev Projects/Flutter Apps/tullip/docs/node_modules/@redocly/openapi-core/lib/config|fs● Client █████████████████████████ building (43%) 3/5 entries 1078/1110 dependencies 292/405 modules 110 active node_modules/@redocly/openapi-core/lib/types/oas3.js● Client █████████████████████████ building (42%) 3/5 entries 1090/1146 dependencies 300/411 modules 105 active node_modules/@redocly/openapi-core/lib/rules/no-unresolved-refs.js● Client █████████████████████████ building (43%) 3/5 entries 1125/1158 dependencies 311/423 modules 110 active node_modules/mark.js/dist/mark.js● Client █████████████████████████ building (43%) 3/5 entries 1140/1176 dependencies 315/434 modules 109 active node_modules/marked/lib/marked.js● Client █████████████████████████ building (42%) 3/5 entries 1155/1186 dependencies 326/440 modules 110 active node_modules/react-tabs/esm/index.js● Client █████████████████████████ building (42%) 3/5 entries 1231/1272 dependencies 330/476 modules 110 active css-loader › postcss-loader › src/components/HomepageFeatures.module.css|0● Client █████████████████████████ building (43%) 3/5 entries 1330/1389 dependencies 353/501 modules 122 active node_modules/core-js/internals/set-species.js● Client █████████████████████████ building (43%) 3/5 entries 1482/1544 dependencies 384/538 modules 146 active node_modules/core-js/internals/document-create-element.js● Client █████████████████████████ building (42%) 3/5 entries 1551/1566 dependencies 396/565 modules 156 active node_modules/core-js/internals/shared.js● Client █████████████████████████ building (42%) 3/5 entries 1575/1583 dependencies 402/575 modules 163 active css-loader › postcss-loader › node_modules/@docusaurus/theme-classic/lib-next/theme/DocItem/styles.module.css|0● Client █████████████████████████ building (43%) 3/5 entries 1633/1658 dependencies 452/578 modules 124 active node_modules/mobx-react-lite/es/index.js● Client █████████████████████████ building (43%) 3/5 entries 1661/1681 dependencies 467/598 modules 131 active node_modules/buffer/index.js● Client █████████████████████████ building (43%) 3/5 entries 1710/1746 dependencies 472/607 modules 127 active node_modules/builtin-status-codes/browser.js● Client █████████████████████████ building (43%) 3/5 entries 1750/1766 dependencies 477/633 modules 140 active node_modules/core-js/internals/array-includes.js● Client █████████████████████████ building (43%) 3/5 entries 1779/1823 dependencies 494/635 modules 141 active css-loader › postcss-loader › node_modules/@docusaurus/theme-classic/lib-next/theme/DocSidebar/styles.module.css|0● Client █████████████████████████ building (42%) 3/5 entries 1827/1838 dependencies 520/646 modules 117 active css-loader › postcss-loader › node_modules/@docusaurus/theme-classic/lib-next/theme/BackToTopButton/styles.module.css|0● Client █████████████████████████ building (43%) 3/5 entries 1834/1841 dependencies 545/648 modules 103 active node_modules/core-js/internals/to-absolute-index.js● Client █████████████████████████ building (43%) 3/5 entries 1853/1861 dependencies 573/659 modules 80 active node_modules/@emotion/memoize/dist/memoize.browser.esm.js● Client █████████████████████████ building (43%) 3/5 entries 1875/1907 dependencies 584/667 modules 78 active ignored|/Users/bharat/Documents/Projects/Dev Projects/Flutter Apps/tullip/docs/node_modules/readable-stream/lib|util● Client █████████████████████████ building (42%) 3/5 entries 1903/1921 dependencies 606/673 modules 67 active node_modules/readable-stream/lib/internal/streams/async_iterator.js● Client █████████████████████████ building (42%) 3/5 entries 1927/1929 dependencies 621/683 modules 61 active css-loader › postcss-loader › node_modules/@docusaurus/theme-common/lib/components/Details/styles.module.css|0● Client █████████████████████████ building (43%) 3/5 entries 1930/1931 dependencies 631/683 modules 52 active node_modules/string_decoder/lib/string_decoder.js● Client █████████████████████████ building (43%) 3/5 entries 1937/1941 dependencies 652/688 modules 33 active node_modules/util-deprecate/browser.js● Client █████████████████████████ sealing (70%) plugins● Client █████████████████████████ sealing (75%) chunk optimization RemoveEmptyChunksPlugin● Client █████████████████████████ sealing (87%) code generation● Client █████████████████████████ sealing (88%) runtime requirements● Client █████████████████████████ sealing (89%) after hashing● Client █████████████████████████ sealing (92%) asset processing● Client █████████████████████████ emitting (98%) after emit✖ Client Compiled with some errors in 11.37s
ℹ 「wds」: Project is running at http://localhost:3000/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /Users/bharat/Documents/Projects/Dev Projects/Flutter Apps/tullip/docs
ℹ 「wds」: 404s will fallback to /index.html
warn Docs markdown link couldn't be resolved: (../tutorial-extras/manage-docs-versions.md) in /Users/bharat/Documents/Projects/Dev Projects/Flutter Apps/tullip/docs/docs/tutorial-basics/congratulations.md for version current
warn Docs markdown link couldn't be resolved: (../tutorial-extras/translate-your-site.md) in /Users/bharat/Documents/Projects/Dev Projects/Flutter Apps/tullip/docs/docs/tutorial-basics/congratulations.md for version current
warn Docs markdown link couldn't be resolved: (./create-a-page.md) in /Users/bharat/Documents/Projects/Dev Projects/Flutter Apps/tullip/docs/docs/tutorial-basics/markdown-features.mdx for version current
Module parse failed: Unexpected token (6:130)
File was processed with these loaders:
* ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| * This source code is licensed under the MIT license found in the
| * LICENSE file in the root directory of this source tree.
> */import React from'react';const ThemeContext=/*#__PURE__*/React.createContext(undefined);ThemeContext.displayName="ThemeContext"export default ThemeContext;
Your environment
- Public source code:
- Public site URL:
- Docusaurus version used:
- Environment name and version (e.g. Chrome 78.0.3904.108, Node.js 10.17.0): Node v14.17.4 & NPM v6.14.14
- Operating system and version (e.g. Ubuntu 20.04.2 LTS): MacOS 11.4
Reproducible demo
Use https://new.docusaurus.io to create a CodeSandbox reproducible demo of the bug.
(Paste the link to an example repo, including a docusaurus.config.js, and exact instructions to reproduce the issue.)
Reacted by Justin Burnham, mengkeding and Jaewook Oh
Activity
wookiist commentedon Aug 5, 2021
Exactly the same error has also been to me! Is this a problem that only occurs in the latest version?
Josh-Cena commentedon Aug 5, 2021
Fixed in #5270. If you want to try that latest patched version, use the canary release
csestito commentedon Aug 5, 2021
@Josh-Cena I was able to reproduce this using a fresh npm @docusaurus/init of alpha.72. It looks like a bunch of babel packages were updated a few hours ago, likely the culprit but I haven't been able to pin down which.
Josh-Cena commentedon Aug 5, 2021
Errr... By "reproduce" you mean "make the links work" or "make them not work"?
csestito commentedon Aug 5, 2021
Make it not work, with a fresh install no modifications. I added all babel resolutions to not allow any of them to fetch the latest and it works now. Can try to figure out which in particular did it, but it's definitely a babel issue that is being propagated to docusaurus.
Josh-Cena commentedon Aug 5, 2021
For one thing, the bug should be fixed by the latest canary release already. Also, alpha-72 sounds pretty ancient, and it's better to reproduce the bug on newer versions than older ones
medinLaVie commentedon Aug 5, 2021
Error still persists after pulling from canary for me.
npm install --save-exact @docusaurus/core@canary @docusaurus/preset-classic@canaryJosh-Cena commentedon Aug 5, 2021
If you can verify that your docusaurus version is
2.0.0-beta.2c0b82e7a, then your issue may be more unique... In any case, we can wait for another fix / reply from maintainermedinLaVie commentedon Aug 5, 2021
This resolves the build error for me.
csestito commentedon Aug 5, 2021
I tried on the latest stable beta release first, as the issue creator did and noted above, and I got the same error. I then tried on alpha-72 to see if it was a docusaurus issue or a package issue because I knew alpha-72 didn't have the same problem.
I suspect anyone installing fresh or upgrade packages will have the same problem because it seems to be a result of the latest babel which is fetched by a few docusaurus requirements.
I was able to narrow it down to @babel/plugin-transform-react-display-name. Adding
"resolutions": { "@babel/plugin-transform-react-display-name": "7.14.5" },seems to fix it for me.
BK1031 commentedon Aug 5, 2021
The temporary solution from @csestito works for me as well. Since the actual fix is already in the canary release and will probably make it onto prod soon I will close this issue for now.
lex111 commentedon Aug 5, 2021
That's right, there was a bug in
plugin-transform-react-display-name, so Babel maintainers released bug fix release.Just reinstall your dependencies, and the issue will be resolved.
slorber commentedon Aug 5, 2021
Thanks
We are not alone having this issue 😅
Can confirm re-generating the lockfile should work, fix has been published 1h ago in @babel/[email protected] with PR babel/babel#13637