national-gold•2y ago
Error: Error: Cannot find module '/home/myuser/dist/main.js'
I am getting the error: Error:
when trying to run a successfull build for my actor on Apify, but locally it works without errors.
I have disabled a lot of linting and warnings as they serve me no real purpose other than stop my typescript compliation from succeeding.
It is a Typescript Crawlee project.
Do you have any idea of what might be the cause?
8 Replies
Hi, it looks like docker build doesn't put built js files to the right place. Could you share the content of your Dockerfile?
You must have changed something from the template
national-goldOP•2y ago
@ondro_k yes here it is https://gist.github.com/Trubador/594a646e20595d1818ae934e04d6a32c
national-goldOP•2y ago
Hmm I will try to delve into what might be changed
national-goldOP•2y ago
I have done some changes in tsconfig: https://gist.github.com/Trubador/11420aebe1f1d871498a7fd0abad7d87
Gist
apify tsconfig.json - modified
apify tsconfig.json - modified. GitHub Gist: instantly share code, notes, and snippets.
national-goldOP•2y ago
I have done the cahnges in tsconfig to try to disable warnings for unused variables as this should not make compilation fail as it is just a warning
not a critical error
stormy-gold•13mo ago
did you ever fix this? I'm running into same issue
I gues for module options You should use "NodeNext":
Otherwise, just update apify-cli to the latest version and regenerate it from the template.