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

Add vscode .devcontainer settings for dockerized development environment #48

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HenryJk
Copy link

@HenryJk HenryJk commented Dec 10, 2021

This PR is adding basic settings for dockerizing dev environment in vscode. Developing inside a docker container allows for easy setup and isolates the dev environment from your machine, preventing the project from polluting the global installation. Also, for easy access to different node version without using nvm.

@thmsndk
Copy link
Contributor

thmsndk commented Dec 12, 2021

@HenryJk I am on windows, and I am getting the following error when I try to start the server, I am trying to work around the crash others experience in #36 by running it as a container. have you experienced this error using this container?

keep in mind this is the first time I am using a dockerized dev container as dev environment, so I might be missing some steps for it to work.

root@docker-desktop:/workspaces/xxscreeps# npx xxscreeps start
🌎 Listening

node:internal/process/esm_loader:94
    internalBinding('errors').triggerUncaughtException(
                              ^
Error: /workspaces/xxscreeps/node_modules/isolated-vm/out/isolated_vm.node: invalid ELF header
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/workspaces/xxscreeps/node_modules/isolated-vm/isolated-vm.js:1:18)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
  code: 'ERR_DLOPEN_FAILED'
}

@thmsndk
Copy link
Contributor

thmsndk commented Dec 12, 2021

Okay it works now, the issue was my node_modules was from windows, deleting that and installing it with npm install from inside the docker container / visual studio code fixed the issues and I was able to start the server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants