Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Default images can't be rendered: "The "path" argument must be of type string. Received type number (58)" #6774

Closed
5 of 7 tasks
jakehemmerle opened this issue Feb 26, 2022 · 2 comments · Fixed by #6779
Closed
5 of 7 tasks
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

@jakehemmerle
Copy link

Have you read the Contributing Guidelines on issues?

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

Tutorial images will not load in default initialization. Same w some icons. Those files that "can't be read" do exist and render fine when opened with an image viewer.

I have manually patched the default initialization with this PR, but I don't think they're related.

Reproducible demo

https://github.com/astarnetwork/docs

Steps to reproduce

yarn create docusaurus docs classic --typescript or
yarn create docusaurus docs classic

then start it

yarn start

i suspect this still happens using npm or other package managers

Expected behavior

Shouldn't see errors in the console, images should appear on the site.

Actual behavior

✔ Client
  Compiled successfully in 11.24s

[ERROR] The image at /Users/jake/codebases/astar/test/blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg can't be read correctly. Please ensure it's a valid image.
The "path" argument must be of type string. Received type number (58)
[ERROR] The image at /Users/jake/codebases/astar/test/blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg can't be read correctly. Please ensure it's a valid image.
The "path" argument must be of type string. Received type number (130)
[ERROR] The image at /Users/jake/codebases/astar/test/static/img/tutorial/localeDropdown.png can't be read correctly. Please ensure it's a valid image.
The "path" argument must be of type string. Received type number (131)
[ERROR] The image at /Users/jake/codebases/astar/test/static/img/docusaurus.png can't be read correctly. Please ensure it's a valid image.
The "path" argument must be of type string. Received type number (132)
[ERROR] The image at /Users/jake/codebases/astar/test/static/img/tutorial/docsVersionDropdown.png can't be read correctly. Please ensure it's a valid image.
The "path" argument must be of type string. Received type number (133)
client (webpack 5.69.1) compiled successfully

✔ Client
  Compiled successfully in 169.78ms

Your environment

  • Public source code: https://github.com/astarnetwork/docs
  • Public site URL:
  • Docusaurus version used: latest beta
  • Environment name and version (e.g. Chrome 89, Node.js 16.4): yarn 3.2.0; node 16.14.0
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): macos 12.1

Self-service

  • I'd be willing to fix this bug myself.
@jakehemmerle jakehemmerle 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 Feb 26, 2022
@Josh-Cena
Copy link
Collaborator

Hi, are you using Yarn PnP? I have constantly encountered this using PnP. Might be related to yarnpkg/berry#3889

@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 27, 2022
@Josh-Cena
Copy link
Collaborator

Also, this is only an error log. It neither blocks your build nor makes your images unrenderable.

# for free to join this conversation on GitHub. Already have an account? # 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
2 participants