#error TS1005

30 messages · Page 1 of 1 (latest)

golden coral
#

Im desperate, fighting with that error for a day now. Removed the dist, cleaned the npm cache. Do u have any idea why it's expecting that while it's already here

#

tsc version in 4.8.4

errant python
golden coral
#

Yup it's running in a container but I rebuild the image every single time

#

seems unable to do the trick

errant python
golden coral
#

yes

errant python
#

can you provide all the docker files?

golden coral
#

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
errant python
#

how about the .dockerignore file?

errant python
golden coral
#
.gitignore
.git
*.md
errant python
#

by each time building the container

#

you're also copying the dist folder to the container

errant python
#

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

golden coral
#

Ok ty for help, bit better but still get my error ahhaaaaaa

golden coral
#

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

errant python
hasty nimbus
#

Docker apart, non-sense issues are often solved by deleting dist folder

errant python
#

but in the last screenshot they sent, that's a .ts file located in the src folder

hasty nimbus
#

is this node on windows? It does some really weird thing sometimes

errant python