fair-rose
fair-rose2y ago

Quick start example fails to build

I'm using the very basic quick start example from https://crawlee.dev/docs/quick-start with simplest TypeScript template. First running npx crawlee create my-crawler and after cd my-crawler && npm start it runs successfully. But running "npm run build" fails with: PS C:\Projects\crawlee\my-crawler> npm run build > my-crawler@0.0.1 build > tsc node_modules/@crawlee/cheerio/internals/cheerio-crawler.d.ts:3:23 - error TS2688: Cannot find type definition file for 'node_modules/got/dist/source/core/timed-out'. 3 /// <reference types="node_modules/got/dist/source/core/timed-out" /> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ node_modules/@crawlee/jsdom/internals/jsdom-crawler.d.ts:3:23 - error TS2688: Cannot find type definition file for 'node_modules/got/dist/source/core/timed-out'. 3 /// <reference types="node_modules/got/dist/source/core/timed-out" /> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ node_modules/@crawlee/linkedom/internals/linkedom-crawler.d.ts:3:23 - error TS2688: Cannot find type definition file for 'node_modules/got/dist/source/core/timed-out'. 3 /// <reference types="node_modules/got/dist/source/core/timed-out" />
5 Replies
correct-apricot
correct-apricot2y ago
Having the same issue personally
correct-apricot
correct-apricot2y ago
GitHub
TypeScript builds fail when generated from 'npx crawlee create' · I...
Which package is this bug report for? If unsure which one to select, leave blank None Issue description Using "npx crawlee create my-crawler" and then choosing a TypeScript template resul...
correct-apricot
correct-apricot2y ago
Looks like downgrading to 3.6.x should resolve
exotic-emerald
exotic-emerald2y ago
I solved this issue by adding "skipLibCheck": true in my tsconfig.json file:
{
"extends": "@apify/tsconfig",
"compilerOptions": {
"module": "NodeNext",
"moduleResolution": "NodeNext",
"target": "ES2022",
"outDir": "dist",
"noUnusedLocals": false,
"lib": [
"DOM",
"ES2021.String"
],
"skipLibCheck": true
},
"include": [
"./src/**/*"
]
}
{
"extends": "@apify/tsconfig",
"compilerOptions": {
"module": "NodeNext",
"moduleResolution": "NodeNext",
"target": "ES2022",
"outDir": "dist",
"noUnusedLocals": false,
"lib": [
"DOM",
"ES2021.String"
],
"skipLibCheck": true
},
"include": [
"./src/**/*"
]
}
Lukas Krivka
Lukas Krivka2y ago
Please upgrade to Crawlee 3.7, it is fixed there

Did you find this page helpful?