cardano-foundation / developer-portal

The Cardano Developer Portal
https://developers.cardano.org
MIT License
378 stars 909 forks source link

Can't build the app locally; #1343

Open Fell-x27 opened 2 hours ago

Fell-x27 commented 2 hours ago

OS: Linux Mint Virginia (Ubuntu Based) NodeJS: 22.9.0

Error:

[ERROR] Error while parsing Markdown front matter.
This can happen if you use special characters in front matter values (try using double quotes around that value).
[ERROR] Loading of version failed for version current
[ERROR] Unable to build website for locale en.
[ERROR] Error: Can't process doc metadata for doc at path path=./developer-portal/docs/governance/cardano-improvement-proposals/CIP-0127.md in version name=current
    at processDocMetadata (./developer-portal/node_modules/@docusaurus/plugin-content-docs/lib/docs.js:200:15)
    at async Promise.all (index 207)
[INFO] Docusaurus version: 2.4.3
Node version: v22.9.0

Steps to reproduce in a clean environment:


#HOST OS
#preparing env
sudo apt install lxc
sudo lxc-create -n test -t download -- --dist mint --release virginia --arch amd64

#HOST OS
#run and log in
sudo lxc-start -n test
sudo lxc-attach -n test

#########################

#CONTAINER OS
#install stuff
apt install git curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
source ~/.bashrc
nvm install node
npm install -g yarn

#CONTAINER OS
#clone repo and build it with yarn
git clone https://github.com/cardano-foundation/developer-portal.git
cd developer-portal
yarn install
yarn build

#see the error...

#CONTAINER OS
#leave the container
exit

#########################

#HOST OS
# stop and remove it
sudo lxc-stop -n test
sudo lxc-destroy -n test
Fell-x27 commented 2 hours ago

If I add:

    if (cip_name === "./CIP-0127") {
        return "";
    }

to the processCIPContentAsync function in order to ignore this file, everything works just perfect.

But it's not the solution, of course. There's something wrong with the file that needs to be fixed:

This can happen if you use special characters in front matter values (try using double quotes around that value).

Probably , it's the " ` " symbols in the YAML part?