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

fix: locale missing page - no data due to missing await #10550

Merged
merged 1 commit into from
Feb 19, 2024

Conversation

hochan222
Copy link
Member

@hochan222 hochan222 commented Feb 19, 2024

Summary

An error occurred when accessing page http://localhost:3000/ko/_translations/missing.

While adding async to the gatherL10NstatsSection method, await seems to be missing.

Problem

The browser is unable to receive data from the server because await is missing.

Solution

const found = gatherL10NstatsSection({ locale }); => const found = await gatherL10NstatsSection({ locale });


Screenshots

Before

image image

After

image image

@hochan222 hochan222 requested a review from a team as a code owner February 19, 2024 14:47
@hochan222
Copy link
Member Author

hochan222 commented Feb 19, 2024

There are also errors on the flaws page. Can anyone help me with this? (cc. @mdn/localization-team-leads, @mdn/mdn-community-engagement )

The http://localhost:3000/ko/_flaws page also 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.

image



(1) 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.

(2) The phrase is exposed because there is no counts.built value. In the server code below, counts.built is treated as a falsy value because the doc does not exist.

(3) When I see the comment in code below that there are no flaws if there is no doc, is this a case where there are no flaws? If so, I would like to change the UI to recognize that there are no flaws.

yari/server/flaws.ts 225 Line

    const { doc } = JSON.parse(fs.readFileSync(filePath, "utf-8")) as {
      doc: Doc;
    };

    // The home page, for example, also uses a `index.json` but it doesn't have
    // flaws, so let's not count it if it doesn't have a `doc` key.
    if (!doc) {
      continue;
    }

/Users/holee/Desktop/mdn/yari/client/build/ko/index.json file info

// console.log(JSON.parse(fs.readFileSync(filePath, "utf-8")));
오후 11:35:31 server.1   | {
오후 11:35:11 server.1    |    hyData: {
오후 11:35:11 server.1    |      recentContributions: { items: [Array] },
오후 11:35:11 server.1    |      featuredContributor: null,
오후 11:35:11 server.1    |      latestNews: { items: [Array] },
오후 11:35:11 server.1    |      featuredArticles: [ [Object], [Object] ]
오후 11:35:11 server.1    |    }
오후 11:35:11 server.1    |  }
image

Looking at the flaws in the page below, it seems like there is a problem somewhere.

image

Copy link
Contributor

@fiji-flo fiji-flo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. Can you move the other issue related to flaws not being analyzed to a separate issue?

@fiji-flo fiji-flo merged commit d022ba5 into mdn:main Feb 19, 2024
8 checks passed
@hochan222 hochan222 deleted the bugfix/missing-page branch March 5, 2024 15:21
@hochan222
Copy link
Member Author

Thank you Yes, I will.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants