standards-hub / docs

A documentation template made with Nuxt UI Pro.
https://standards-hub.github.io/docs/
0 stars 0 forks source link

[Live website is not working correctly] #164

Closed jpradocueva closed 1 month ago

jpradocueva commented 1 month ago

The latest changes, the addition of new floating micro-cards, introduce some stability issues in the live website. www

The right menus don't move, and the landing page displays some code.

FroudeDescartes commented 1 month ago

@jpradocueva I can see the issue as well. I will inspect it and tag you once I find the solution

FroudeDescartes commented 1 month ago

@jpradocueva I can see in the console two errors that would imply that it did not populate the site with content and components as expected (although when run locally, everything works). I would say this is the same thing as in today`s meeting when we had a non-working ToC.

Please, try and generate -> deploy again and see if the results are still the same. If they are, I will investigate further.

jpradocueva commented 1 month ago

@FroudeDescartes I generated and deployed the website three times, with mixed results. I will do it once more after I reset my system.

FroudeDescartes commented 1 month ago

Resolved with PR#259

FroudeDescartes commented 1 month ago

ToC is still not visible, maybe I will take a different approach in implementing it

jpradocueva commented 1 month ago

@FroudeDescartes I run ChatGPT based on the errors and this is what it has provided:

Issue: Static Page Generation Warnings and Errors During Nuxt Build Process

Description:

During the generation of static pages using Nuxt, the following warnings and errors were encountered. This issue seems to be related to multiple 404 errors and excessive chunk sizes. Below is a summary of the key issues:

Warnings:

  1. Chunk Size Warning:

    • [ ] Some chunks are larger than 500 kB after minification.
    • [ ] Suggested actions:
      • [ ] Use dynamic import() to code-split the application.
      • [ ] Modify build.rollupOptions.output.manualChunks to improve chunking as outlined in Rollup's documentation.
      • Adjust chunk size limit via build.chunkSizeWarningLimit in the Nuxt configuration.
  2. Module "stream" Externalization Warning:

    • [ ] Vite has externalized the stream module for browser compatibility.
    • [ ] This warning is triggered by the sax library in node_modules/sax/lib/sax.js.
    • [ ] Suggested fix: Review the Vite documentation.

Errors:

  1. Document Not Found (404) Errors:

    • Multiple 404 errors were encountered for missing documents during the static page generation process. The following paths are affected:

      • [ ] /omaspecworks/get-involved/faq
      • [ ] /lwm2m/contact-us
      • [ ] /lwm2m/community/www.ioterop.com/iowa
      • [ ] /www.ericsson.com/en
      • [ ] /www.ericsson.com/en/portfolio
      • [ ] /www.ericsson.com/en/portfolio/digital-services
      • [ ] /www.ericsson.com/en/portfolio/digital-services/cloud-core
      • [ ] /www.ericsson.com/en/portfolio/digital-services/cloud-core/cloud-unified-data-management-and-policy
    • These errors suggest that the linked documents or resources are missing or have incorrect paths.

  2. Linked Documents Issue:

    • Each 404 error is linked from a specific route, which indicates a missing document or an incorrect reference.
    • Possible causes:
      • [ ] Missing JSON files in the api/_content directory.
      • [ ] Incorrect linking paths in the markdown or component files.
      • [ ] Unresolved paths for dynamic content.

Suggested Fixes:

  1. Address Chunk Size Warning:

    • [ ] Split large components or pages into smaller modules using dynamic imports.
    • [ ] Consider lazy loading non-critical components.
  2. Resolve Missing Documents:

    • [ ] Verify that the paths in the source code are correctly defined.
    • [ ] Check if the content exists in the /api/_content directory.
    • [ ] Create or update the missing documents where applicable.
  3. Correct External Module Reference:

    • [ ] Investigate the usage of the sax library and determine if an alternative approach is feasible for client-side usage.
  4. Skip or Correct Broken Links:

    • [ ] Update the routes or remove references to missing documents if they are obsolete.

Logs:

Additional Context:

jpradocueva commented 1 month ago

@FroudeDescartes, this is the link to another clue as to why the news pages are not displaying on the temp. website. See below:

markdown Copy code

Issue: Error When Opening News Pages

Error Message:

{
  "message": "You should use slots with <ContentRenderer>",
  "value": null,
  "excerpt": false,
  "tag": "div"
}

Description: The error is triggered when attempting to open a news link stored in the news/articles folder. The issue is likely related to how the ContentRenderer component is being used in the Nuxt application. The ContentRenderer expects content to be passed via slots, and if these slots are not correctly configured or the content is missing, the component will throw this error.

Why the Error Occurs:

1. Missing or Incorrect Slot Usage:

2. Content Formatting Issue:

3. Incorrect Component Usage:

Suggested Fixes:

1. Use Slots Correctly:

Ensure that the ContentRenderer component is used with appropriate slots, as shown in the example below:

Copy code
<ContentRenderer>
  <template #default="{ content }">
    <div v-html="content"></div>
  </template>
</ContentRenderer>

2. Check Content Existence:

3. Update Content Module Configuration:

4. Debug Content Loading Logic:

Example Fix in Template:

If you have a template rendering a news article, update it as follows:

Copy code
<template>
  <ContentRenderer>
    <template #default="{ content }">
      <div v-if="content" v-html="content.value"></div>
      <div v-else>
        <p>Error: Content could not be rendered. Please check the source.</p>
      </div>
    </template>
  </ContentRenderer>
</template>

In this example, we are using a default slot to ensure that the ContentRenderer has access to the content property and is able to render it correctly.

Additional Considerations:

FroudeDescartes commented 1 month ago
jpradocueva commented 1 month ago
FroudeDescartes commented 1 month ago

Resolved in PR#274