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

run docusaurus start ,http://localhost:3000/ is not available #4717

Closed
lxchinesszz opened this issue May 3, 2021 · 17 comments
Closed

run docusaurus start ,http://localhost:3000/ is not available #4717

lxchinesszz opened this issue May 3, 2021 · 17 comments
Labels
closed: question This issue is a user error/misunderstanding.

Comments

@lxchinesszz
Copy link

http://localhost:3000/ is not available

➜ node -v
v13.14.0

@docusaurus/init@2.0.0-alpha.75

@lxchinesszz lxchinesszz 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 May 3, 2021
@nam-hle
Copy link
Contributor

nam-hle commented May 3, 2021

Hi @lxchinesszz, please use the bug report template. It will save the maintainers to develop this awesome projects :)

@lxchinesszz
Copy link
Author

This may not be a bug, I don't know why I usually just go to: http://localhost:3000/ after NPM start to debug. But I recently found out that when I typed NPM start, the Docusaurus website was running. But you cannot visit http://localhost:3000. At the same time, there is no error message.

@Josh-Cena
Copy link
Collaborator

  1. Did you take a complete screenshot of your commandline output? It seems the bottom half is missing.
  2. Did your app finish compiling? It should show something like Compiled successfully in 16.87s.

If not, your issue is likely a duplicate of #4713. I am experiencing the same issue and let's wait for a response from the dev :P

@slorber
Copy link
Collaborator

slorber commented May 3, 2021

Can you try on alpha 74 and see if it works better?

@slorber
Copy link
Collaborator

slorber commented May 4, 2021

@lxchinesszz I really need a repro to be able to help you on this, and showing logs/screenshots won't be enough in this case. If the repo is private, you can give me private access on Github.

Are you using MDX imports at the top of your markdown files? (could be related to #4726)

Is this the repo? https://github.com/lxchinesszz/scm-website (it does not look like, as your screenshot show "ddd-website").

I suggest trying alpha74 to see if this is a bug in latest release (new Webpack 5 support, more risky to break things)

Also you'd rather use Node 12 or 14 instead of Node 13.

Any particularity to mention about your site? Does it have custom plugins, custom weback config or whatever?

@tdurand
Copy link

tdurand commented May 5, 2021

same problem try to run the default template

npx @docusaurus/init@latest init my-website classic
cd my-website
npm run start

Node version

v12.19.0

Tried to downgrade to alpha.74 but get same issue.

@slorber
Copy link
Collaborator

slorber commented May 5, 2021

I'll need more context abut your env please, because using same node/commands works for me (latest MacOS).

Can those reporting this issue try both alpha 75 and alpha 74? (fix the version, don't use ^)
So that we can be sure if it's related to Webpack 5 or not.

 ~/Desktop/projects  nvm use 12.19                                                                                                                                                    ✓  10025  19:25:12
Now using node v12.19.1 (npm v6.14.8)
 ~/Desktop/projects  npx @docusaurus/init@latest init my-website classic                                                                                                              ✓  10026  19:25:17
cd my-website
npm run start
npx: installed 40 in 4.797s

Creating new Docusaurus project ...

Installing dependencies with: yarn
yarn install v1.22.5
info No lockfile found.
[1/4] Resolving packages...
warning @docusaurus/core > webpack-dev-server > chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
warning @docusaurus/core > webpack-dev-server > chokidar > fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
warning @docusaurus/core > webpack-dev-server > chokidar > braces > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
warning @docusaurus/core > webpack-dev-server > chokidar > braces > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > file-loader@6.2.0" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
warning " > url-loader@4.1.1" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
warning "@docusaurus/preset-classic > @docusaurus/theme-search-algolia > @docusaurus/theme-common@2.0.0-alpha.75" has unmet peer dependency "prism-react-renderer@^1.1.1".
warning "@docusaurus/preset-classic > @docusaurus/theme-search-algolia > @docsearch/react@3.0.0-alpha.36" has unmet peer dependency "@types/react@>= 16.8.0 < 18.0.0".
warning "@docusaurus/preset-classic > @docusaurus/theme-search-algolia > @docsearch/react > @algolia/autocomplete-preset-algolia@1.0.0-alpha.44" has unmet peer dependency "@algolia/client-search@^4.5.1".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 38.44s.


Success! Created my-website
Inside that directory, you can run several commands:

  yarn start
    Starts the development server.

  yarn build
    Bundles the app into static files for production.

  yarn deploy
    Publish website to GitHub pages.

We suggest that you begin by typing:

  cd my-website
  yarn start

Happy hacking!

> my-website@0.0.0 start /Users/sebastienlorber/Desktop/projects/my-website
> docusaurus start

Starting the development server...
Docusaurus website is running at: http://localhost:3000/

✔ Client
  Compiled successfully in 8.51s

ℹ 「wds」: Project is running at http://localhost:3000/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /Users/sebastienlorber/Desktop/projects/my-website
ℹ 「wds」: 404s will fallback to /index.html

image

@tdurand
Copy link

tdurand commented May 5, 2021

More details, I don't think it is related to webpack as I have the same problem with alpha.74 and alpha.75 , website never show up

I'm on Windows 10 with WSL 2 . Ubuntu 18.04

With alpha.75 :

> docusaurus start

Starting the development server...
Docusaurus website is running at: http://localhost:3000/

✔ Client
  Compiled successfully in 31.05s

ℹ 「wds」: Project is running at http://localhost:3000/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /mnt/c/Users/tibod/Documents/GitHub/playground/my-website
ℹ 「wds」: 404s will fallback to /index.html
Watchpack Error (initial scan): Error: EACCES: permission denied, lstat '/mnt/c/DumpStack.log.tmp'
Watchpack Error (initial scan): Error: EACCES: permission denied, lstat '/mnt/c/hiberfil.sys'
Watchpack Error (initial scan): Error: EACCES: permission denied, lstat '/mnt/c/swapfile.sys'
Watchpack Error (initial scan): Error: EACCES: permission denied, lstat '/mnt/c/pagefile.sys'

With alpha.74 (fixed)

npm i
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.

added 672 packages, removed 38 packages, changed 87 packages, and audited 2023 packages in 1m

178 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
❯ npm run start

> my-website@0.0.0 start
> docusaurus start

Starting the development server...
Docusaurus website is running at: http://localhost:3000/

✔ Client
  Compiled successfully in 39.10s

ℹ 「wds」: Project is running at http://localhost:3000/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /mnt/c/Users/tibod/Documents/GitHub/playground/my-website
ℹ 「wds」: 404s will fallback to /index.html

Gonna try right now directly on Ubuntu 18.04 (not from Windows) to see what happen

@tdurand
Copy link

tdurand commented May 5, 2021

Ok, it works with Ubuntu 18.04 , Node v12.18.1

Will try with v12.19.0 to see if it comes from that

@tdurand
Copy link

tdurand commented May 5, 2021

Works also with Ubuntu 18.04 , node v12.19.0 , so problem is with WSL 2 on windows.. will see if I can try a few more things..

@tdurand
Copy link

tdurand commented May 6, 2021

Some update on this, I'm sorry I reported the issue in the first place, this seems unrelated to docusaurus , since yesterday I can't access anything running on WSL2 .. I'm looking ways to fix it, but you can close this I guess, exploring microsoft/WSL#5298 , will report here once I find a fix for future googlers 😉

@tdurand
Copy link

tdurand commented May 6, 2021

For anyone landing here, here is the fix: https://dev.to/wetterkrank/wsl2-localhost-3000-issue-191b

@lxchinesszz
Copy link
Author

@lxchinesszz我真的需要一个propro才能为您提供帮助,在这种情况下,显示日志/屏幕截图是不够的。如果仓库是私人的,则可以在Github上给我私人访问。

您是否在Markdown文件顶部使用MDX导入?(可能与#4726有关

这是回购吗?https://github.com/lxchinesszz/scm-website(它看起来不像,因为您的屏幕截图显示为“ ddd-website”)。

我建议尝试使用alpha74来查看这是否是最新版本中的错误(新的Webpack 5支持,更容易出错)

另外,您宁愿使用节点12或14而不是节点13。

关于您的网站有什么特殊之处吗?它是否具有自定义插件,自定义weback配置或其他功能?

I'm very sorry for replying to your message so late. After reading the following reply from Tdurand, I think what he said is right. It probably had nothing to do with the docusaurs version, because I also found that sometimes he was successful and sometimes he waited. Unable to access port 3000. But I think if this was the case docusaurs could give a more intuitive and friendly indication. Would it be better? What do you think?

@slorber
Copy link
Collaborator

slorber commented May 6, 2021

Thanks @tdurand , going to close then

@lxchinesszz are you also on Windows or using WSL?
How are we supposed to provide a more friendly error message?
If you have a technical suggestion that we could use, please submit a PR, because I don't have any idea how to do that technically. Maybe it's rather the responsibility of Webpack to throw a meaningful error instead?

@slorber slorber closed this as completed May 6, 2021
@camsong
Copy link

camsong commented May 25, 2021

I have the same problem on Mac Big Sur X1, please reopen it.

@lxchinesszz
Copy link
Author

I have the same problem on Mac Big Sur X1, please reopen it.

Suggest you to change a port to run, I solve like this.

@camsong
Copy link

camsong commented May 25, 2021

@lxchinesszz I changed the port but still got error, raised a new issue: #4842

@Josh-Cena Josh-Cena added closed: question This issue is a user error/misunderstanding. and removed 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 Feb 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: question This issue is a user error/misunderstanding.
Projects
None yet
Development

No branches or pull requests

6 participants