-
-
Notifications
You must be signed in to change notification settings - Fork 328
Description
Problem
Codespaces users may find graphQL errors when running commands without &&. the examples in the quick commands reference guide do not include &&.
Broken command (for some codespace users)
FCC_BLOCK='workshop-cat-photo-app' pnpm run clean-and-develop
Working command
FCC_BLOCK='workshop-cat-photo-app' && pnpm run clean-and-develop
Suggestion:
Include note/callout that mentions a possible problem for codespace users when they run the commands without && signs.
================
More Info
================
I am (personally) able to recreate the error failed - createPages which leads to a pathing problem and sends devs to the 404 page not found screen.
Prerequisites:
Use codespaces and follow advice suggested in issue freeCodeCamp/freeCodeCamp#992. This includes changing the codespaces core number to its max (as of writing 4)
Have an up-to-date version of node. This can be achieved using nvm or fnm. I used fnm which is saved on Zsh. This did require editing .devcontainer/devcontainer.json file to
{
"name": "freeCodeCampDC",
"dockerComposeFile": "docker-compose.yml",
"service": "devcontainer",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"forwardPorts": [3000, 8000],
"portsAttributes": {
"3000": {
"label": "API",
"onAutoForward": "silent"
},
"8000": {
"label": "Client",
"onAutoForward": "notify"
}
},
"otherPortsAttributes": {
"onAutoForward": "silent"
},
"onCreateCommand": "[ ! -f .env ] && cp sample.env .env || true",
"updateContentCommand": "pnpm install && pnpm seed",
// ~/.local/share/fnm/fnm
"postCreateCommand": "curl -fsSL https://fnm.vercel.app/install | bash -s -- --install-dir ~/.local/share/fnm --skip-shell && echo 'export PATH=\"$HOME/.local/share/fnm:$PATH\"' >> $HOME/.zshrc && echo 'eval \"$(fnm env --use-on-cd --version-file-strategy=recursive)\"' >> $HOME/.zshrc",
"postStartCommand": "zsh -c 'fnm install 24.12.0 -- --force && fnm default 24.12.0'",
"postAttachCommand": {
"instructions": "bash -c 'echo \"\n Start a new terminal and run \\`pnpm run develop\\` when you are ready.\n\"'"
}
}Steps to reproduce
- Open zsh.
- run
fnm use 24.12.0 - run
FCC_BLOCK='workshop-cat-photo-app pnpm run clean-and-develop'
Here is where I saw the error failed - createPages and the graphQL slug error with the journey to the 404 page.
To correct this I found that running the same command with && fixed the issue
- run
FCC_BLOCK='workshop-cat-photo-app && pnpm run clean-and-develop'