Skip to content

Typescript wont work inside Docker #22084

Answered by nemanjam
nemanjam asked this question in Docker
Discussion options

You must be logged in to vote

The solution for this is to have two extended tsconfig.json, same like on host. Otherwise I would have to have double package.json and yarn.lock, one for host, another to install Cypress with dependencies in container. Option with 2 tsconfig.json and cypress run --project seems more elegant.

Dockerfile.e2e

# MUST repeat everything from host
# /app/package.json
# /app/tsconfig.json
# /app/tests-e2e/cypress.json 
# /app/tests-e2e/tsconfig.json 
COPY tests-e2e/package.json tests-e2e/yarn.lock ./

# important: tsconfig.json parent/child same like on host
COPY tsconfig.json ./
COPY tests-e2e/tsconfig.json ./tests-e2e/tsconfig.json

tests-e2e/tsconfig.json

{
  "extends": "../tsconfig.json",
  "c…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by nemanjam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Docker
Labels
None yet
1 participant