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

LAMP Docs Update Failures due to Outdated Node.js Version #826

Open
MattMatt27 opened this issue Aug 22, 2024 · 18 comments
Open

LAMP Docs Update Failures due to Outdated Node.js Version #826

MattMatt27 opened this issue Aug 22, 2024 · 18 comments
Assignees
Labels
bug Something isn't working docs LAMP-docs priority HIGH High priority item

Comments

@MattMatt27
Copy link
Contributor

Describe the bug
I just tried making a very minor change to LAMP-platform (fix the favicon path) but the gh-release build failed and I am wondering if this is a more serious concern that requires addressing. It looks like a few of the packages are now expecting a Node.js version of 18 and we are still using 16. See build error below.

Run npm install
npm WARN ERESOLVE overriding peer dependency
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18.17' },
npm WARN EBADENGINE   current: { node: 'v16.20.2', npm: '8.19.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18.17' },
npm WARN EBADENGINE   current: { node: 'v16.20.2', npm: '8.19.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.20.2', npm: '8.19.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.20.2', npm: '8.19.4' }
npm WARN EBADENGINE }
...
Error:  Unable to build website for locale en.
Error:  ReferenceError: ReadableStream is not defined
    at Object.<anonymous> (/home/runner/work/LAMP-platform/LAMP-platform/node_modules/undici/lib/web/fetch/response.js:527:3)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
    at Module.require (node:internal/modules/cjs/loader:1100:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/home/runner/work/LAMP-platform/LAMP-platform/node_modules/undici/lib/web/fetch/index.js:11:5)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
Error: Process completed with exit code 1.

To Reproduce
Steps to reproduce the behavior:

  1. Make a change in LAMP-platform package.json
  2. Commit changes
  3. gh-release should fail

Expected behavior
gh-release should succeed and changes should be reflected in the documentation

Desktop (please complete the following information):

  • GitHub issue, all devices and OS affected

Additional context
Based on my understanding it seems like the two potential solutions are upgrading our Node.js version to 18. Or adding package specific version dependencies for all failing packages so that they continue to work on Node 16.

@MattMatt27 MattMatt27 added bug Something isn't working docs LAMP-docs priority MEDIUM Medium priority item labels Aug 22, 2024
@ZCOEngineer
Copy link

We shall review this @MattMatt27

@sarithapillai8
Copy link
Contributor

sarithapillai8 commented Aug 24, 2024

@MattMatt27 This needs to be done across all repositories, including LAMP-server, LAMP-js, LAMP-worker, LAMP-dashboard, and LAMP-activities (for all activities). It will be a time-consuming process, and we need to thoroughly test each functionality after making the changes. We shall look into this.

@kijote0 kijote0 added priority HIGH High priority item and removed priority MEDIUM Medium priority item labels Oct 15, 2024
@kijote0
Copy link
Contributor

kijote0 commented Oct 15, 2024

@sarithapillai8 Would it be possible to prioritize this issue? Currently, we are unable to update our documentation for mindLAMP due to this problem with Node.js.

@michaelmenon
Copy link

@kijote0 sure we will start on this on a priority.

@sarithapillai8
Copy link
Contributor

sarithapillai8 commented Oct 17, 2024

@MattMatt27 There are some other errors with the build. Could you please let us know if we need to fix that or will you check it ?


docusaurus build --no-minify

[INFO] [en] Creating an optimized production build...
Error faking a schema. Not faking this schema. Schema: {
  type: 'object',
  properties: { data: { type: 'array', maxItems: 2, items: [Object] } }
  type: 'object',
  properties: { data: { type: 'array', maxItems: 2, items: [Object] } }
} Error Error: unknown registry key {
  "type": "string"
} in /properties/data/items/1/properties/schema/properties
    at run (/home/runner/work/LAMP-platform/LAMP-platform/node_modules/openapi-to-postmanv2/assets/json-schema-faker.js:2[47](https://github.com/BIDMCDigitalPsychiatry/LAMP-platform/actions/runs/11383573117/job/31669492471#step:4:48)70:21)
    at jsf (/home/runner/work/LAMP-platform/LAMP-platform/node_modules/openapi-to-postmanv2/assets/json-schema-faker.js:2[48](https://github.com/BIDMCDigitalPsychiatry/LAMP-platform/actions/runs/11383573117/job/31669492471#step:4:49)13:14)
    at safeSchemaFaker (/home/runner/work/LAMP-platform/LAMP-platform/node_modules/openapi-to-postmanv2/lib/schemaUtils.js:187:19)
    at Object.convertToPmBodyData (/home/runner/work/LAMP-platform/LAMP-platform/node_modules/openapi-to-postmanv2/lib/schemaUtils.js:1353:20)
    at Object.convertToPmResponseBody (/home/runner/work/LAMP-platform/LAMP-platform/node_modules/openapi-to-postmanv2/lib/schemaUtils.js:1203:25)
    at Object.convertToPmResponse (/home/runner/work/LAMP-platform/LAMP-platform/node_modules/openapi-to-postmanv2/lib/schemaUtils.js:1836:32)
    at /home/runner/work/LAMP-platform/LAMP-platform/node_modules/openapi-to-postmanv2/lib/schemaUtils.js:2329:34
    at /home/runner/work/LAMP-platform/LAMP-platform/node_modules/openapi-to-postmanv2/node_modules/lodash/lodash.js:[49](https://github.com/BIDMCDigitalPsychiatry/LAMP-platform/actions/runs/11383573117/job/31669492471#step:4:50)25:15
    at baseForOwn (/home/runner/work/LAMP-platform/LAMP-platform/node_modules/openapi-to-postmanv2/node_modules/lodash/lodash.js:2990:24)
    at Function.forOwn (/home/runner/work/LAMP-platform/LAMP-platform/node_modules/openapi-to-postmanv2/node_modules/lodash/lodash.js:13040:24)
Error faking a schema. Not faking this schema. Schema: {
  type: 'object',
  properties: {
    data: { type: 'array', maxLength: 1, maxItems: 2, items: [Object] }
  }
} Error Error: unknown registry key {
  "type": "string"
} in /properties/data/items/0/properties/schema/properties
    at run (/home/runner/work/LAMP-platform/LAMP-platform/node_modules/openapi-to-postmanv2/assets/json-schema-faker.js:24770:21)
    at jsf (/home/runner/work/LAMP-platform/LAMP-platform/node_modules/openapi-to-postmanv2/assets/json-schema-faker.js:24813:14)
    at safeSchemaFaker (/home/runner/work/LAMP-platform/LAMP-platform/node_modules/openapi-to-postmanv2/lib/schemaUtils.js:187:19)
    at Object.convertToPmBodyData (/home/runner/work/LAMP-platform/LAMP-platform/node_modules/openapi-to-postmanv2/lib/schemaUtils.js:1353:20)
    at Object.convertToPmResponseBody (/home/runner/work/LAMP-platform/LAMP-platform/node_modules/openapi-to-postmanv2/lib/schemaUtils.js:1[203](https://github.com/BIDMCDigitalPsychiatry/LAMP-platform/actions/runs/11383573117/job/31669492471#step:4:204):25)
    at Object.convertToPmResponse (/home/runner/work/LAMP-platform/LAMP-platform/node_modules/openapi-to-postmanv2/lib/schemaUtils.js:1836:32)
    at /home/runner/work/LAMP-platform/LAMP-platform/node_modules/openapi-to-postmanv2/lib/schemaUtils.js:2329:34
    at /home/runner/work/LAMP-platform/LAMP-platform/node_modules/openapi-to-postmanv2/node_modules/lodash/lodash.js:4925:15
    at baseForOwn (/home/runner/work/LAMP-platform/LAMP-platform/node_modules/openapi-to-postmanv2/node_modules/lodash/lodash.js:2990:24)
    at Function.forOwn (/home/runner/work/LAMP-platform/LAMP-platform/node_modules/openapi-to-postmanv2/node_modules/lodash/lodash.js:13040:24)
Error:  Error: Retrieval of git history failed at /home/runner/work/LAMP-platform/LAMP-platform/docs/08-develop/12-Training Modules/01-training-modules.md with exit code 128: fatal: ambiguous argument '/home/runner/work/LAMP-platform/LAMP-platform/docs/08-develop/12-Training': unknown revision or path not in the working tree.

@MattMatt27
Copy link
Contributor Author

@sarithapillai8 If you are able to fix this, it would be greatly appreciated! I did a quick investigation to see if I could figure out why that might be failing but had no luck. The LAMP-platform/docs/08-develop/12-Training Modules/01-training-modules.md file has not been updated in a year so I am surprised that it would be running into problems.

@sarithapillai8
Copy link
Contributor

Ok we can check on that @MattMatt27

@sarithapillai8
Copy link
Contributor

@MattMatt27 Can you check the updates done? The build issues seem to be fixed.

@MattMatt27
Copy link
Contributor Author

@sarithapillai8 Unfortunately it looks like the docs are no longer working after this update. I get the following when I go to https://docs.lamp.digital/

Screenshot 2024-10-29 at 10 45 20 AM

@sarithapillai8
Copy link
Contributor

We need some time to fix this issue. I tried reverting, but that brought back the original issue we started. I'll work to resolve this as soon as possible.

@sarithapillai8
Copy link
Contributor

sarithapillai8 commented Nov 5, 2024

@MattMatt27 I’ve been working to resolve the issues by creating code from scratch, updating to the latest versions of React and Docusaurus, and copying the documentation files. I've managed to fix many issues, and I can now see the build files on my local system. The site loads with some errors related to the OpenAPI documentation, though I can still navigate between pages after closing the error pop-up.

Current versions are React 18, Node 20, and Docusaurus 3.6.0

I'm currently stuck on an issue: "TypeError: The 'from' argument must be of type string. Received undefined." When debugging, I identified that this error might be caused by the openapi.yml file (potentially due to version changes) or by files generated inside the docusaurus-plugin-openapi/api directory. The undefined schema error may also be related to syntax like this in openapi.tml file:

schema:
  "$ref": "#/components/schemas/Activity"

I'm uncertain which reference is causing the issue. Could you take a look and help troubleshoot? Please see the working screenshots below.

image

image

@kijote0
Copy link
Contributor

kijote0 commented Nov 5, 2024

@sarithapillai8 I think in the interest of getting the docs back up as soon as possible, we should perhaps exclude the pages that are causing this error and keep track of the specific pages that are excluded in a comment on this issue so that we can go back and revisit them once we have the docs.lamp.digital back up and running.

@sarithapillai8
Copy link
Contributor

@kijote0 API docs removed and updated. https://docs.lamp.digital - This site is now loading except the API section. We can continue on this to fix that issue.

@kijote0
Copy link
Contributor

kijote0 commented Nov 6, 2024

@sarithapillai8 Sounds good, thank you!

@kijote0
Copy link
Contributor

kijote0 commented Nov 11, 2024

@sarithapillai8 When I tried to edit one of the pages in the docs, I received the following error message.
error1
error2
It seems that there might be some version compatibility issues with docusaurus packages.
Would it be possible to get some help with resolving this?

@sarithapillai8
Copy link
Contributor

@kijote0 Could you please let me know if you've incorporated the latest changes I made before updating?

@kijote0
Copy link
Contributor

kijote0 commented Nov 12, 2024

@sarithapillai8 I believe so, I had modified one specific page of the docs using the "Edit" button and directly committed to the main branch; I made a few commits, but there were all to the same page and just to modify text. Here is the link to the most recent commit I made: b1f1606.

@sarithapillai8
Copy link
Contributor

@kijote0 Updated the build issue. Please have a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working docs LAMP-docs priority HIGH High priority item
Projects
None yet
Development

No branches or pull requests

5 participants