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

Brand new docusaurus installation not building #5287

Closed
5 tasks done
BK1031 opened this issue Aug 4, 2021 · 13 comments
Closed
5 tasks done

Brand new docusaurus installation not building #5287

BK1031 opened this issue Aug 4, 2021 · 13 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution external This issue is caused by an external dependency and not Docusaurus.

Comments

@BK1031
Copy link

BK1031 commented Aug 4, 2021

🐛 Bug Report

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

Just created a new docusaurus installation following the getting started guide

Have you read the Contributing Guidelines on issues?

yep

Steps to reproduce

  1. npx @docusaurus/init@latest init my-website classic
  2. cd 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.)

@BK1031 BK1031 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 Aug 4, 2021
@wookiist
Copy link

wookiist commented 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
Copy link
Collaborator

Fixed in #5270. If you want to try that latest patched version, use the canary release

@csestito
Copy link

csestito commented 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
Copy link
Collaborator

Errr... By "reproduce" you mean "make the links work" or "make them not work"?

@csestito
Copy link

csestito commented 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.

"resolutions": {
    "@babel/cli": "7.14.5",
    "@babel/core": "7.14.8",
    "@babel/parser": "7.14.9",
    "@babel/compat-data": "7.14.9",
    "@babel/generator": "7.14.9",
    "@babel/helper-compilation-targets": "7.14.5",
    "@babel/helper-create-class-features-plugin": "7.14.8",
    "@babel/helper-member-expression-to-functions": "7.14.7",
    "@babel/helper-module-transforms": "7.14.8",
    "@babel/helper-replace-supers": "7.14.5",
    "@babel/plugin-transform-modules-commonjs": "7.14.5",
    "@babel/plugin-transform-react-display-name": "7.14.5",
    "@babel/plugin-transform-runtime": "7.14.5",
    "@babel/plugin-transform-typescript": "7.14.6",
    "@babel/preset-env": "7.14.9",
    "@babel/traverse": "7.14.9",
    "@babel/types": "7.14.9"
  },

@Josh-Cena
Copy link
Collaborator

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
Copy link

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

Error still persists after pulling from canary for me. npm install --save-exact @docusaurus/core@canary @docusaurus/preset-classic@canary

@Josh-Cena
Copy link
Collaborator

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 maintainer

@medinLaVie
Copy link

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.

"resolutions": {
    "@babel/cli": "7.14.5",
    "@babel/core": "7.14.8",
    "@babel/parser": "7.14.9",
    "@babel/compat-data": "7.14.9",
    "@babel/generator": "7.14.9",
    "@babel/helper-compilation-targets": "7.14.5",
    "@babel/helper-create-class-features-plugin": "7.14.8",
    "@babel/helper-member-expression-to-functions": "7.14.7",
    "@babel/helper-module-transforms": "7.14.8",
    "@babel/helper-replace-supers": "7.14.5",
    "@babel/plugin-transform-modules-commonjs": "7.14.5",
    "@babel/plugin-transform-react-display-name": "7.14.5",
    "@babel/plugin-transform-runtime": "7.14.5",
    "@babel/plugin-transform-typescript": "7.14.6",
    "@babel/preset-env": "7.14.9",
    "@babel/traverse": "7.14.9",
    "@babel/types": "7.14.9"
  },

This resolves the build error for me.

@csestito
Copy link

csestito commented 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
Copy link
Author

BK1031 commented 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
Copy link
Contributor

lex111 commented 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
Copy link
Collaborator

slorber commented 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/plugin-transform-react-display-name@7.15.1 with PR babel/babel#13637

@Josh-Cena Josh-Cena added external This issue is caused by an external dependency and not Docusaurus. and removed status: needs triage This issue has not been triaged by maintainers labels Feb 22, 2022
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 external This issue is caused by an external dependency and not Docusaurus.
Projects
None yet
Development

No branches or pull requests

7 participants