mdn / yari

The platform code behind MDN Web Docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`http://localhost:3000/<locale>/_flaws` locale page error

hochan222 opened this issue · comments

Summary

The http://localhost:3000/ko/_flaws page shows

"No documents have been built, so no flaws can be found At the moment, you have to use the command line tools to build documents that we can analyze."

even though the yarn build was completed.

URL

http://localhost:3000/<locale>/_flaws

ex)
http://localhost:3000/ko/_flaws

Reproduction steps

  1. nvm use && yarn
  2. yarn build

The /yari/client/build/ko/index.json file was created normally.

Built 41,917 pages in 28.7 minutes, at a rate of 24.3 documents per second.
Peak heap memory usage: 1.60 GB
...
✨ Done in 1725.75s.

  1. yarn dev

Expected behavior

flaw page where flaw items are detected

Actual behavior

"No documents have been built, so no flaws can be found At the moment, you have to use the command line tools to build documents that we can analyze."

Device

Laptop

Browser

Chrome

Browser version

Stable

Operating system

Mac OS

Screenshot

image

Anything else?

more details: #10550 (comment)

Validations

@hochan222 Do you recall when this last worked, or has this always been broken?

@caugner This always been broken. Also other contributor has confirmed that the same error happens.

If it is working properly, please let me know the execution steps after cloning and I will check it.

I actually think the problem is that you run yarn dev after yarn build, which overwrites the client/build directory (via yarn build:client). Can you try yarn start instead, or running yarn build after yarn dev has started the development server? (Note that you still need to run yarn client:build from time to time after pulling.)

Image

@caugner Thank you. The flaws page looks good. I guess I'm missing something. Did you proceed as in case 1 below?

@1ilsang Is it going to work out? I'm not working well case 1 ~ 3. hmm...


  • case 1: git clone => nvm use => sudo yarn => create .env file (for CONTENT_TRANSLATED_ROOT, CONTENT_ROOT) => sudo yarn start => http://localhost:3000/ko/_flaws => fail
  • case 2: git clone => nvm use => sudo yarn => create .env file => sudo yarn start => sudo yarn client:build => sudo yarn start => http://localhost:3000/ko/_flaws => fail
  • case 3: git clone => nvm use => sudo yarn => create .env file => yarn client:build => sudo yarn start => http://localhost:3000/ko/_flaws => fail
  • case 4: git clone => nvm use => sudo yarn => create .env file => sudo yarn dev => sudo yarn build => sudo yarn start => http://localhost:3000/ko/_flaws => success

@caugner Anyway, since I built it after yarn dev, it came out well! Thank you.

The build process seems to be essential, so it would be good to close the issue.

image
  • case 1: git clone => nvm use => sudo yarn => create .env file (for CONTENT_TRANSLATED_ROOT, CONTENT_ROOT) => sudo yarn start => http://localhost:3000/ko/_flaws => fail

  • case 2: git clone => nvm use => sudo yarn => create .env file => sudo yarn start => sudo yarn client:build => sudo yarn start => http://localhost:3000/ko/_flaws => fail

  • case 3: git clone => nvm use => sudo yarn => create .env file => yarn client:build => sudo yarn start => http://localhost:3000/ko/_flaws => fail

@hochan222 Two questions:

  1. Do you need to run yarn with sudo privileges? (This doesn't look right.)
  2. Is the failure you refer to this error: (This PR should fix that.)
    error: ENOENT: no such file or directory, open '/path/to/yari/popularities.json'
    

@caugner Currently, the flaws page is not working in case 1. (main branch)

  1. It used to fail when running without sudo, but now it works fine even without sudo.

I don't remember the error, but I think a permission error occurred in the cloud-function-related download (maybe..?) when executing the yarn command. It's been happening for the past week when I recently ran yari, but it hasn't happened today..! (Or... I shut down the computer completely, but there may have been something wrong with me.)

It's working fine now.

  1. By failure I meant the _flaws page error below. Also, I'm getting the following error in the fix-yarn-start-add-popularities branch.
image

I don't remember the error, but I think a permission error occurred in the cloud-function-related download

I have seen a permission-related error here: #10717
Otherwise it could have been an error related to downloading @vscode/ripgrep, which regularly fails.

Please report the error message the next time you are seeing it.

2. By failure I meant the _flaws page error below. Also, I'm getting the following error in the fix-yarn-start-add-popularities branch.

It might be nice if the error message said what command to run, e.g.: "Run yarn build --locale ko to build all documents for the current locale." Feel free to open a PR! 😉

Since it is working fine for you now, I'm going ahead and close this issue as resolved. 🎉

@caugner I understand! Confirmed that it works well!

Thank you very much for your help in resolving the difficulty.

Feel free to open a PR!😉

Yes I will. Also, I will write the ko locale guide related to current issues.

Have a good one :)