freeCodeCamp / near-curriculum

BSD 3-Clause "New" or "Revised" License
26 stars 12 forks source link

[BUG]: Contents not visible on VScode #57

Closed ShyanRoyChoudhury closed 8 months ago

ShyanRoyChoudhury commented 8 months ago

Issue/Experience

Screenshot 2024-01-18 143743

ShaunSHamilton commented 8 months ago

Hello there,

on opening the parent folder above near-curriculum, the contents are then visible however on opening the specific new-curriculum folder the issue occurs.

What do you mean by that?

The files are supposed to be hidden, until the course is started: https://github.com/freeCodeCamp/near-curriculum/blob/main/.vscode/settings.json

ShyanRoyChoudhury commented 8 months ago

I meant that when I 'open folder' the near-curriculum repo. None of the files are visible. As mentioned in the freecodecamp page that i have to 'cmd+shift+P' then 'Dev Containers: Rebuild Container and Reopen in Container'. On doing the mentioned steps vscode prompts me that a .devcontainer file already exists but doesn't run the container instead. I need help setting up and running the devcontainer to start the course

ShaunSHamilton commented 8 months ago

I meant that when I 'open folder' the near-curriculum repo. None of the files are visible.

That is expected. It is just a UI change, and the files should still be there and visible if you type ls in the terminal.

ShyanRoyChoudhury commented 8 months ago

Yes, This I understood. When i changed the files excluded in settings.json. But how to start the existing dev container and run the course?

ShaunSHamilton commented 8 months ago

I have no issues getting the course running after following the steps provided. So, I cannot think why yours does not start.

ShyanRoyChoudhury commented 8 months ago

Could you please mention if you followed any other step other than the ones mentioned here?

Screenshot 2024-01-18 at 8 36 16 PM
ShaunSHamilton commented 8 months ago

Ah. I updated VSCode and am able to reproduce what you are seeing. The current solution is to downgrade the Dev Containers extension to an older version. I was on 0.309.0 and it worked:

image

I hope this helps

ShaunSHamilton commented 8 months ago

Related to: https://github.com/microsoft/vscode-remote-release/issues/9378

ShyanRoyChoudhury commented 8 months ago

changed the version to 0.309.0 but getting this error now while setting up the container. Even tried other devcontainer version, similar error

[23 ms] Dev Containers 0.309.0 in VS Code 1.85.1 (0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2).
[22 ms] Start: Resolving Remote
[39 ms] Setting up container for folder or workspace: /Users/swarnankee/Desktop/test/near-curriculum
[39 ms] Context: desktop-linux
[41 ms] Start: Check Docker is running
[42 ms] Start: Run: docker version --format {{.Server.APIVersion}}
[132 ms] Server API version: 1.43
[133 ms] Start: Run: docker volume ls -q
[190 ms] Start: Run: docker ps -q -a --filter label=vsch.local.folder=/Users/swarnankee/Desktop/test/near-curriculum --filter label=vsch.quality=stable
[250 ms] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/Users/swarnankee/Desktop/test/near-curriculum --filter label=devcontainer.config_file=/Users/swarnankee/Desktop/test/near-curriculum/.devcontainer/devcontainer.json
[308 ms] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/Users/swarnankee/Desktop/test/near-curriculum
[367 ms] Start: Run: /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) --ms-enable-electron-run-as-node /Users/swarnankee/.vscode/extensions/ms-vscode-remote.remote-containers-0.309.0/dist/spec-node/devContainersSpecCLI.js read-configuration --workspace-folder /Users/swarnankee/Desktop/test/near-curriculum --id-label devcontainer.local_folder=/Users/swarnankee/Desktop/test/near-curriculum --id-label devcontainer.config_file=/Users/swarnankee/Desktop/test/near-curriculum/.devcontainer/devcontainer.json --log-level debug --log-format json --config /Users/swarnankee/Desktop/test/near-curriculum/.devcontainer/devcontainer.json --mount-workspace-git-root true
[565 ms] @devcontainers/cli 0.51.1. Node.js v18.15.0. darwin 23.1.0 arm64.
[565 ms] Start: Run: git rev-parse --show-cdup
[579 ms] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/Users/swarnankee/Desktop/test/near-curriculum --filter label=devcontainer.config_file=/Users/swarnankee/Desktop/test/near-curriculum/.devcontainer/devcontainer.json
[637 ms] Start: Run: /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) --ms-enable-electron-run-as-node /Users/swarnankee/.vscode/extensions/ms-vscode-remote.remote-containers-0.309.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /Users/swarnankee/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --container-session-data-folder /tmp/devcontainers-8a9aaa8b-8bbc-4885-8670-7f3732c166a51705593144790 --workspace-folder /Users/swarnankee/Desktop/test/near-curriculum --workspace-mount-consistency cached --id-label devcontainer.local_folder=/Users/swarnankee/Desktop/test/near-curriculum --id-label devcontainer.config_file=/Users/swarnankee/Desktop/test/near-curriculum/.devcontainer/devcontainer.json --log-level debug --log-format json --config /Users/swarnankee/Desktop/test/near-curriculum/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --remove-existing-container --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[836 ms] @devcontainers/cli 0.51.1. Node.js v18.15.0. darwin 23.1.0 arm64.
[836 ms] Start: Run: docker buildx version
[1083 ms] github.com/docker/buildx v0.12.0-desktop.2 c5a13b51c1ae9358eb691e9a21c955590e26d0a0
[1083 ms] 
[1083 ms] Start: Resolving Remote
[1085 ms] Start: Run: git rev-parse --show-cdup
[1095 ms] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/Users/swarnankee/Desktop/test/near-curriculum --filter label=devcontainer.config_file=/Users/swarnankee/Desktop/test/near-curriculum/.devcontainer/devcontainer.json
[1154 ms] Start: Run: docker inspect --type image ubuntu:20.04
[1211 ms] local container features stored at: /Users/swarnankee/.vscode/extensions/ms-vscode-remote.remote-containers-0.309.0/dist/node_modules/vscode-dev-containers/container-features
[1212 ms] Start: Run: tar --no-same-owner -x -f -
[1220 ms] Start: Run: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /var/folders/zc/scwrtcl51r94_3dhvp878yzm0000gn/T/devcontainercli/container-features/0.51.1-1705593146725/Dockerfile-with-features -t vsc-near-curriculum-7c0f25ef23ba50eca44a6832490bf6f0ad57914362ab7ee96bfe6c32c3486ded --target dev_containers_target_stage --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label /Users/swarnankee/Desktop/test/near-curriculum
[+] Building 18.7s (16/22)                                 docker:desktop-linux
 => [internal] load build definition from Dockerfile-with-features         0.0s
 => => transferring dockerfile: 1.71kB                                     0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => [internal] load metadata for docker.io/library/ubuntu:20.04            0.0s
 => [internal] load build context                                          0.1s
 => => transferring context: 2.38MB                                        0.1s
 => [dev_container_auto_added_stage_label  1/18] FROM docker.io/library/u  0.0s
 => CACHED [dev_container_auto_added_stage_label  2/18] RUN apt-get updat  0.0s
 => CACHED [dev_container_auto_added_stage_label  3/18] RUN yes | unminim  0.0s
 => CACHED [dev_container_auto_added_stage_label  4/18] RUN ln -snf /usr/  0.0s
 => CACHED [dev_container_auto_added_stage_label  5/18] RUN adduser --dis  0.0s
 => CACHED [dev_container_auto_added_stage_label  6/18] RUN adduser campe  0.0s
 => CACHED [dev_container_auto_added_stage_label  7/18] RUN echo '%sudo A  0.0s
 => CACHED [dev_container_auto_added_stage_label  8/18] RUN sudo apt-get   0.0s
 => CACHED [dev_container_auto_added_stage_label  9/18] RUN curl -fsSL ht  0.0s
 => CACHED [dev_container_auto_added_stage_label 10/18] RUN sudo apt-get   0.0s
 => CACHED [dev_container_auto_added_stage_label 11/18] RUN npm install -  0.0s
 => ERROR [dev_container_auto_added_stage_label 12/18] RUN npm install -  18.6s
------                                                                          
 > [dev_container_auto_added_stage_label 12/18] RUN npm install -g near-sdk-js@0.4.0-5:                                                                         
16.01 npm WARN deprecated source-map-resolve@0.6.0: See https://github.com/lydell/source-map-resolve#deprecated
16.01 npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
18.55 npm ERR! code 1
18.55 npm ERR! path /usr/lib/node_modules/near-sdk-js
18.55 npm ERR! command failed
18.55 npm ERR! command sh -c cd cli && rm -rf deps && mkdir -p deps && cd deps && node ../post-install.js
18.55 npm ERR! uname -s
18.55 npm ERR! uname -m
18.55 npm ERR! aarch64 architecture is unsapported at the moment
18.55 
18.55 npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2024-01-18T15_52_27_449Z-debug-0.log
------
Dockerfile-with-features:43
--------------------
  41 |     # can use for npm install --global
  42 |     RUN npm install -g near-cli@3.4.2
  43 | >>> RUN npm install -g near-sdk-js@0.4.0-5
  44 |     
  45 |     WORKDIR ${HOMEDIR}
--------------------
ERROR: failed to solve: process "/bin/sh -c npm install -g near-sdk-js@0.4.0-5" did not complete successfully: exit code: 1

View build details: docker-desktop://dashboard/build/desktop-linux/desktop-linux/2vb1m5jhunclmmjyp53rpyr6q
[20217 ms] Error: Command failed: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /var/folders/zc/scwrtcl51r94_3dhvp878yzm0000gn/T/devcontainercli/container-features/0.51.1-1705593146725/Dockerfile-with-features -t vsc-near-curriculum-7c0f25ef23ba50eca44a6832490bf6f0ad57914362ab7ee96bfe6c32c3486ded --target dev_containers_target_stage --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label /Users/swarnankee/Desktop/test/near-curriculum
[20217 ms]     at CAA (/Users/swarnankee/.vscode/extensions/ms-vscode-remote.remote-containers-0.309.0/dist/spec-node/devContainersSpecCLI.js:463:1752)
[20217 ms]     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[20217 ms]     at async jw (/Users/swarnankee/.vscode/extensions/ms-vscode-remote.remote-containers-0.309.0/dist/spec-node/devContainersSpecCLI.js:462:1691)
[20218 ms]     at async FK (/Users/swarnankee/.vscode/extensions/ms-vscode-remote.remote-containers-0.309.0/dist/spec-node/devContainersSpecCLI.js:462:610)
[20218 ms]     at async FAA (/Users/swarnankee/.vscode/extensions/ms-vscode-remote.remote-containers-0.309.0/dist/spec-node/devContainersSpecCLI.js:479:3660)
[20218 ms]     at async GC (/Users/swarnankee/.vscode/extensions/ms-vscode-remote.remote-containers-0.309.0/dist/spec-node/devContainersSpecCLI.js:479:4775)
[20218 ms]     at async VeA (/Users/swarnankee/.vscode/extensions/ms-vscode-remote.remote-containers-0.309.0/dist/spec-node/devContainersSpecCLI.js:611:12240)
[20218 ms]     at async WeA (/Users/swarnankee/.vscode/extensions/ms-vscode-remote.remote-containers-0.309.0/dist/spec-node/devContainersSpecCLI.js:611:11981)
[20221 ms] Exit code 1
[20224 ms] Command failed: /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) --ms-enable-electron-run-as-node /Users/swarnankee/.vscode/extensions/ms-vscode-remote.remote-containers-0.309.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /Users/swarnankee/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --container-session-data-folder /tmp/devcontainers-8a9aaa8b-8bbc-4885-8670-7f3732c166a51705593144790 --workspace-folder /Users/swarnankee/Desktop/test/near-curriculum --workspace-mount-consistency cached --id-label devcontainer.local_folder=/Users/swarnankee/Desktop/test/near-curriculum --id-label devcontainer.config_file=/Users/swarnankee/Desktop/test/near-curriculum/.devcontainer/devcontainer.json --log-level debug --log-format json --config /Users/swarnankee/Desktop/test/near-curriculum/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --remove-existing-container --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[20224 ms] Exit code 1
ShaunSHamilton commented 8 months ago

18.55 npm ERR! aarch64 architecture is unsapported at the moment

As mentioned in the error, the tooling required to complete the course is not supported on your machine: https://github.com/near/near-sdk-js/issues/159

Have you tried going through the course on Gitpod?