#error TS1005
30 messages · Page 1 of 1 (latest)
is your app running in a container? maybe the files aren't in sync
Yup it's running in a container but I rebuild the image every single time
seems unable to do the trick
docker container, right?
yes
can you provide all the docker files?
the backend dockerfile :
FROM node:14-alpine
RUN mkdir -p /svr/app
WORKDIR /svr/app
RUN npm i -g @nestjs/cli --silent
COPY package.json .
COPY package-lock.json .
RUN npm install --silent
COPY . .
# Value set in .env file.
EXPOSE $BACKEND_PORT
CMD ["npm", "run", "start:debug"]
my docker-compose
version: "3"
services:
...
backend:
container_name: backend
build:
context: ./backend
dockerfile: Dockerfile
restart: always
env_file: .env
volumes:
- ./backend:/svr/app
- "./scripts/wait.sh:/wait.sh"
- /svr/app/node_modules
networks:
- bp-network
ports:
- "${BACKEND_PORT}:${BACKEND_PORT}"
depends_on:
- bp-pg-db
links:
- bp-pg-db
...
volumes:
pgdata:
pgadmin:
networks:
bp-network:
driver: bridge
and if needed folder structure is like :
backend
-- Dockerfile
frontend
docker-compose.yml
how about the .dockerignore file?
you should avoid mounting the local node_modules to the container
.gitignore
.git
*.md
by each time building the container
you're also copying the dist folder to the container
COPY . .
you should avoid that too
overall I'd suggest the following changes
remove the node_modules volume inside the docker-compose file
volumes:
- ./backend:/svr/app
- "./scripts/wait.sh:/wait.sh"
- - /svr/app/node_modules
add the dist and the node_modules folders to the .dockerignore file
.gitignore
.git
*.md
+ dist/
+ node_modules/
then remove the existing container + its volumes and rebuild everything
Ok ty for help, bit better but still get my error ahhaaaaaa
This is non-sense
I've checked directly in the backend container the file with the error
why the heck it's not copying correctly my file and forgetting the last }
@errant python if u have any clue, ill take them tho
try to remove this volume ./backend:/svr/app or change it to the ./backend/src:/svr/app/src
once again, make sure to delete the existing container and rebuild everything to be sure
Docker apart, non-sense issues are often solved by deleting dist folder
but in the last screenshot they sent, that's a .ts file located in the src folder
is this node on windows? It does some really weird thing sometimes
yea true, windows always does weird things
but I don't think the host OS is important in this case, and the screenshot is from inside of the container, which is on the alpine distro