Cannot find module after build with typescript
This is my typescript config
This is my package json
build happening and i see that dist folder created everything fine, but when im trying to run it locally with
yarn start:prod
i see error (screenshot attachment)
looks like it's trying to reach d.ts file instead of correct routes file not sure how to fix it, i just followed official guide from crawlee dock.
16 Replies
correct-apricotOP•3y ago
It looks like issue happening on configuration level, does author of documentation
https://crawlee.dev/docs/guides/typescript-project
TypeScript Projects | Crawlee
Stricter, safer, and better development experience
correct-apricotOP•3y ago
tried to use it?
Hello @Ararat Martirossyan
Try to put
*.js
on the end of the import path. so it would be something like:
Also I highly suggest you to create a new project with Crawlee CLI
Which should solve these initial things for you.correct-apricotOP•3y ago
Let me try .js is fixing issue, but i need to do it manually? Because i cannot find the way to add .js during bundle
dependent-tan•3y ago
It's a typescript thing, and probably there's a way to add it automatically (some IDE settings), but I just do it manually, yes
correct-apricotOP•3y ago
Yes i have too many imports to add it manually, it can be a problematic for me to do it manually
dependent-tan•3y ago
As mentioned - I don't have a working solution to do it automatically, so maybe someone else could comment...
correct-apricotOP•3y ago
It's alright, it started to work
but Input cannot be used anymore by some reasons

dependent-tan•3y ago
how to you get the input though?
I mean - how to you parse it? Any chance you removed INPUT.json by occasion, or something like that?
correct-apricotOP•3y ago
Im creating input in APIFY panel, and trying to get it from code.


correct-apricotOP•3y ago
I used with Apify and it worked this way, now it returns null, should i commit INPUT.json within my code? If yes then how i can change it dynamically?
@Ararat Martirossyan You need to call
await Actor.getInput()
after the await Actor.init()
correct-apricotOP•3y ago
i thought it was for v2
dependent-tan•3y ago
You should still be able to use it the same way as you have it now, but it has to be after
Actor.init()
call
Actor.init()
(besides some other things generally) sets storage client to Apify client in this case. So when you call it before (as you have now) - it tried to fetch input via memory-storage (crawlee default), and Input.json does not exist there, so you get nullcorrect-apricotOP•3y ago
got it
Thank you to everyone! I wanted to take a moment to express my gratitude for Apify Crawlee - it's been an incredibly useful tool for our company's scraping needs. We've developed 100 scrapers using Crawlee and Apify, and we're currently in the process of migrating to v3. However, we've encountered some issues along the way that we're working to resolve.
By the way, I had a quick question - is there a limit on the number of actors that can be created with Apify Crawlee? I'd appreciate any insight you can provide. Thank you!
@Ararat Martirossyan Yes there is a limitation, check https://docs.apify.com/platform/limits
Limits | Apify Documentation
Learn the Apify platform's resource capability and limitations such as max memory, disk size and number of actors and tasks per user.