Closed BUCKFAE closed 2 years ago
Update:
New Dockerfile:
FROM ubuntu:latest
RUN apt update
RUN apt-get install git nodejs npm curl vim -y
# Cloning showdown
WORKDIR /root/
RUN git clone https://github.com/smogon/pokemon-showdown.git
WORKDIR /root/pokemon-showdown
# Forcing exact version
RUN sed -i 's/\^//g' package.json
RUN cp -r config/config-example.js config/config.js
# Correct node version
RUN npm install -g n
RUN n 14.18.2
# Setup
RUN npm install
Now the server works until I open localhost:8000 to connect to the Server. Then it crashes like this:
RESTORE CHATROOM: lobby
RESTORE CHATROOM: staff
Worker 1 now listening on 0.0.0.0:8000
Test your server at http://localhost:8000
CRASH: TypeError: Cannot set property roomSettings of #<Object> which has only a getter
at Object.loadPlugin (/root/pokemon-showdown/server/chat.ts:1993:64)
at Object.loadPluginFile (/root/pokemon-showdown/server/chat.ts:1916:8)
at Object.loadPluginDirectory (/root/pokemon-showdown/server/chat.ts:1928:11)
at Object.loadPlugins (/root/pokemon-showdown/server/chat.ts:2042:8)
at Object.parse (/root/pokemon-showdown/server/chat.ts:1867:8)
at User.chat (/root/pokemon-showdown/server/users.ts:1414:9)
at Object.socketReceive (/root/pokemon-showdown/server/users.ts:1686:12)
at Object.onSpawn (/root/pokemon-showdown/server/sockets.ts:53:11)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
CRASH: TypeError: Cannot set property roomSettings of #<Object> which has only a getter
at Object.loadPlugin (/root/pokemon-showdown/server/chat.ts:1993:64)
at Object.loadPluginFile (/root/pokemon-showdown/server/chat.ts:1916:8)
at Object.loadPluginDirectory (/root/pokemon-showdown/server/chat.ts:1928:11)
at Object.loadPlugins (/root/pokemon-showdown/server/chat.ts:2042:8)
at Object.parse (/root/pokemon-showdown/server/chat.ts:1867:8)
at User.chat (/root/pokemon-showdown/server/users.ts:1414:9)
at Object.socketReceive (/root/pokemon-showdown/server/users.ts:1686:12)
at Object.onSpawn (/root/pokemon-showdown/server/sockets.ts:53:11)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
CRASH: TypeError: Cannot set property roomSettings of #<Object> which has only a getter
at Object.loadPlugin (/root/pokemon-showdown/server/chat.ts:1993:64)
at Object.loadPluginFile (/root/pokemon-showdown/server/chat.ts:1916:8)
at Object.loadPluginDirectory (/root/pokemon-showdown/server/chat.ts:1928:11)
at Object.loadPlugins (/root/pokemon-showdown/server/chat.ts:2042:8)
at Object.parse (/root/pokemon-showdown/server/chat.ts:1867:8)
at User.chat (/root/pokemon-showdown/server/users.ts:1414:9)
at Object.socketReceive (/root/pokemon-showdown/server/users.ts:1686:12)
at Object.onSpawn (/root/pokemon-showdown/server/sockets.ts:53:11)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
CRASH: TypeError: Cannot set property roomSettings of #<Object> which has only a getter
at Object.loadPlugin (/root/pokemon-showdown/server/chat.ts:1993:64)
at Object.loadPluginFile (/root/pokemon-showdown/server/chat.ts:1916:8)
at Object.loadPluginDirectory (/root/pokemon-showdown/server/chat.ts:1928:11)
at Object.loadPlugins (/root/pokemon-showdown/server/chat.ts:2042:8)
at Object.parse (/root/pokemon-showdown/server/chat.ts:1867:8)
at User.chat (/root/pokemon-showdown/server/users.ts:1414:9)
at Object.socketReceive (/root/pokemon-showdown/server/users.ts:1686:12)
at Object.onSpawn (/root/pokemon-showdown/server/sockets.ts:53:11)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
CRASH: TypeError: Cannot set property roomSettings of #<Object> which has only a getter
at Object.loadPlugin (/root/pokemon-showdown/server/chat.ts:1993:64)
at Object.loadPluginFile (/root/pokemon-showdown/server/chat.ts:1916:8)
at Object.loadPluginDirectory (/root/pokemon-showdown/server/chat.ts:1928:11)
at Object.loadPlugins (/root/pokemon-showdown/server/chat.ts:2042:8)
at Object.parse (/root/pokemon-showdown/server/chat.ts:1867:8)
at User.chat (/root/pokemon-showdown/server/users.ts:1414:9)
at Object.socketReceive (/root/pokemon-showdown/server/users.ts:1686:12)
at Object.onSpawn (/root/pokemon-showdown/server/sockets.ts:53:11)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
I looked at the respective files but I am unable to fix this myself.
Additional Info:
I found an old copy of the showdown folder, not running in a Docker container on my server.
Starting and Connecting to it using ./pokemon-showdown start --no-security
worked just as expected.
After that, I used git pull
to get the latest version. After that, starting still worked as expected.
I then removed the node_modules
folder and ran npm install
again. After that, showdown crashed again as shown above.
I suspect that this is caused by a random dependency? I assume that this is also the reason why the pipeline is currently broken?
I believe that this was fixed in 1c756b111747fceee58fe0572bc3e229015e3588.
Here is my working Dockerfile:
FROM ubuntu:latest
RUN apt update
RUN apt-get install git nodejs npm curl vim -y
# Cloning showdown
WORKDIR /root/
RUN git clone https://github.com/smogon/pokemon-showdown.git
WORKDIR /root/pokemon-showdown
# Setting up config
RUN cp -r config/config-example.js config/config.js
# Changing to correct node version
RUN npm install -g n
RUN n 14.18.2
# Setup
RUN npm install
RUN n latest
does not work for me, I have to explicitly use RUN n 14.18.2
.
This might be helpful to include in the server/README.md (#8826)
I am having this EXACT issue, and have no idea how to get around it.
CRASH: TypeError: Cannot set property roomSettings of #
I am having this EXACT issue, and have no idea how to get around it.
CRASH: TypeError: Cannot set property roomSettings of # which has only a getter at Object.loadPlugin (C:\Users\Public\SGT-Showdown\server\chat.ts:1971:64) at Object.loadPluginFile (C:\Users\Public\SGT-Showdown\server\chat.ts:1894:8) at Object.loadPluginDirectory (C:\Users\Public\SGT-Showdown\server\chat.ts:1906:11) at Object.loadPlugins (C:\Users\Public\SGT-Showdown\server\chat.ts:2020:8) at Object.parse (C:\Users\Public\SGT-Showdown\server\chat.ts:1845:8) at User.chat (C:\Users\Public\SGT-Showdown\server\users.ts:1414:9) at Object.socketReceive (C:\Users\Public\SGT-Showdown\server\users.ts:1686:12) at Object.onSpawn (C:\Users\Public\SGT-Showdown\server\sockets.ts:53:11) at processTicksAndRejections (node:internal/process/task_queues:96:5
I believe that this was fixed in 1c756b1.
Here is my working Dockerfile:
FROM ubuntu:latest RUN apt update RUN apt-get install git nodejs npm curl vim -y # Cloning showdown WORKDIR /root/ RUN git clone https://github.com/smogon/pokemon-showdown.git WORKDIR /root/pokemon-showdown # Setting up config RUN cp -r config/config-example.js config/config.js # Changing to correct node version RUN npm install -g n RUN n 14.18.2 # Setup RUN npm install
RUN n latest
does not work for me, I have to explicitly useRUN n 14.18.2
. This might be helpful to include in the server/README.md (#8826)
Did you try this dockerfile? It works perfectly fine for me.
I am having this EXACT issue, and have no idea how to get around it.
CRASH: TypeError: Cannot set property roomSettings of # which has only a getter at Object.loadPlugin (C:\Users\Public\SGT-Showdown\server\chat.ts:1971:64) at Object.loadPluginFile (C:\Users\Public\SGT-Showdown\server\chat.ts:1894:8) at Object.loadPluginDirectory (C:\Users\Public\SGT-Showdown\server\chat.ts:1906:11) at Object.loadPlugins (C:\Users\Public\SGT-Showdown\server\chat.ts:2020:8) at Object.parse (C:\Users\Public\SGT-Showdown\server\chat.ts:1845:8) at User.chat (C:\Users\Public\SGT-Showdown\server\users.ts:1414:9) at Object.socketReceive (C:\Users\Public\SGT-Showdown\server\users.ts:1686:12) at Object.onSpawn (C:\Users\Public\SGT-Showdown\server\sockets.ts:53:11) at processTicksAndRejections (node:internal/process/task_queues:96:5
I believe that this was fixed in 1c756b1. Here is my working Dockerfile:
FROM ubuntu:latest RUN apt update RUN apt-get install git nodejs npm curl vim -y # Cloning showdown WORKDIR /root/ RUN git clone https://github.com/smogon/pokemon-showdown.git WORKDIR /root/pokemon-showdown # Setting up config RUN cp -r config/config-example.js config/config.js # Changing to correct node version RUN npm install -g n RUN n 14.18.2 # Setup RUN npm install
RUN n latest
does not work for me, I have to explicitly useRUN n 14.18.2
. This might be helpful to include in the server/README.md (#8826)Did you try this dockerfile? It works perfectly fine for me.
I have not tried that no. I followed the step-by-step from the hub, installed. launched. Worked fine several months ago for about... a month or more? Then I didn't check it for awhile.
That error message I pasted was from today.
Hey! I've been playing around with this awesome project for quite some time now but as of today, my Dockerfile stopped working:
Running showdown inside the container yields the following error:
For setup, I followed the instructions at server/README.md
The same issue occurs when I run the project without docker (the error message is identical).
Node on my local machine:
I tried this both on my MacBook as well as on my Linux machine. Same results.