ERROR node-builder RUN npx tsc on attemt to setup Jest

Fernando, thanks a lot. Your solutions and explanation give me a good starting point to make it up and running.

After replacing the typescript with the ts-patch and adding other changes you are listed, I faced another problem. It was impossible to use import and export declarations.

error TS6131: Cannot compile modules using option 'outFile' unless the '--module' flag is 'amd' or 'system'

To overcome it I was forced to make additional changes in the local.yml

  1. Changing
js_entrypoint: "build/index.js"

with

path: "/nakama/data/modules/build"
  1. Replacing "outFile": "./build/index.js", with "outDir": "./build" in tsconfig,json
  2. Replacing
COPY --from=node-builder /backend/build/*.js /nakama/data/modules/build/

with

COPY --from=node-builder /backend/build/ /nakama/data/modules/build/

in the Dockerfile.

Thanks a lot for the help.

1 Like