-
Notifications
You must be signed in to change notification settings - Fork 968
Update docusaurus and fix undefined tags #1451
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
base: staging
Are you sure you want to change the base?
Update docusaurus and fix undefined tags #1451
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jasagredo for taking an interest. FYI this site generally does Docusaurus updates at intervals a lot more widely spaced than this. There are also long term integration issues that @katomm I think has the best view of.
In the meantime, the scripts used in this build I see are working in the GitHub CI environment but fail on my local machine after one or more of the version bumps in package.json
:
$ yarn build
/home/rphair/archive/build/developer-portal/node_modules/ts-node/dist/index.js:851
return old(m, filename);
^
Error [ERR_REQUIRE_ESM]: ...
This (at the first step, the building of the Token Registry) can be confirmed in isolation with:
$ ./node_modules/.bin/ts-node scripts/token-registry.ts
/home/rphair/archive/build/developer-portal/node_modules/ts-node/dist/index.js:851
return old(m, filename);
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/rphair/archive/build/developer-portal/node_modules/node-fetch/src/index.js from /home/rphair/archive/build/developer-portal/scripts/reusable.ts not supported.
Instead change the require of index.js in /home/rphair/archive/build/developer-portal/scripts/reusable.ts to a dynamic import() which is available in all CommonJS modules.
at require.extensions.<computed> [as .js] (/home/rphair/archive/build/developer-portal/node_modules/ts-node/dist/index.js:851:20)
at Object.<anonymous> (/home/rphair/archive/build/developer-portal/scripts/reusable.ts:13:22)
at m._compile (/home/rphair/archive/build/developer-portal/node_modules/ts-node/dist/index.js:857:29)
at require.extensions.<computed> [as .ts] (/home/rphair/archive/build/developer-portal/node_modules/ts-node/dist/index.js:859:16)
at Object.<anonymous> (/home/rphair/archive/build/developer-portal/scripts/token-registry.ts:15:20)
at m._compile (/home/rphair/archive/build/developer-portal/node_modules/ts-node/dist/index.js:857:29)
at require.extensions.<computed> [as .ts] (/home/rphair/archive/build/developer-portal/node_modules/ts-node/dist/index.js:859:16)
at phase4 (/home/rphair/archive/build/developer-portal/node_modules/ts-node/dist/bin.js:466:20)
at bootstrap (/home/rphair/archive/build/developer-portal/node_modules/ts-node/dist/bin.js:54:12)
at main (/home/rphair/archive/build/developer-portal/node_modules/ts-node/dist/bin.js:33:12)
at Object.<anonymous> (/home/rphair/archive/build/developer-portal/node_modules/ts-node/dist/bin.js:579:5) {
code: 'ERR_REQUIRE_ESM'
Which Node and Yarn versions are you using?
|
I tested this with the baseline that we've already indicated to the public here (https://developers.cardano.org/docs/portal-contribute/#requirements): Indeed the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@katomm @jasagredo I'll put out a PR to bump the node
version to v22
here (as per #1451 (comment)) some time soon. I'll double check that the new ts-node
requires at least this LTS to build the token registry (as I recall if failed on v20
but I'll check one more time).
Please note that the files .node-version and .yarn-version are the ones that define which version of node and yarn will be used to build the developer portal on the server. |
Checklist
yarn build
after adding my changes without getting any errors.I have not committed any changes toI am updating docusaurus, so this is necessary.yarn.lock
(or have removed these changes)Updating documentation or Bugfix
When doing some changes to the documentation, I found that a new Docusaurus version was available:
These other errors showed up, for which I did the changes in this PR:
After the changes, the website can be loaded without warnings or errors: