Comments (6)
Can confirm that this also happens to me on latest version. I have a temporary fix; unsure if this is correct though because so many .any()
.
I found out that this happens because the Zod schema for the Config file (in the config.ts
file was slightly wrong). Specifically, the pushData
function that is passed in await config.onVisitPage({ page, pushData })
comes from PlaywrightCrawler and should have 2 arguments.
Therefore, I fixed it in the config.ts
file so that it also reflects the "pushData function have 2 args" in the Config type:
onVisitPage: z
.function()
.args(
z.object({
page: Page,
pushData: z.function().args(z.any(), z.any().optional()).returns(z.promise(z.void())), // Two function args
}),
)
.returns(z.promise(z.void()))
.optional(),
from gpt-crawler.
Hey, also having this issue. Any updates on a potential fix?
root@dev-server-ubuntu:/opt/gpt-crawler# npm start
> @builder.io/[email protected] start
> npm run start:dev
> @builder.io/[email protected] start:dev
> cross-env NODE_ENV=development npm run build && node dist/src/main.js
> @builder.io/[email protected] build
> tsc
src/core.ts:88:46 - error TS2322: Type '(data: ReadonlyDeep<Dictionary | Dictionary[]>, datasetIdOrName?: string | undefined) => Promise<void>' is not assignable to type '(args_0: any, ...args_1: unknown[]) => Promise<void>'.
Types of parameters 'datasetIdOrName' and 'args_1' are incompatible.
Type 'unknown' is not assignable to type 'string | undefined'.
88 await config.onVisitPage({ page, pushData });
~~~~~~~~
src/config.ts:66:9
66 pushData: z.function().args(z.any()).returns(z.promise(z.void())),
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The expected type comes from property 'pushData' which is declared here on type '{ page: Page; pushData: (args_0: any, ...args_1: unknown[]) => Promise<void>; }'
Found 1 error in src/core.ts:88
from gpt-crawler.
Same error here, the newest build seems to be broken.
from gpt-crawler.
Anyone receiving this error message? Trying to run on Windows.
src/core.ts:87:44 - error TS2322: Type '(data: ReadonlyDeep<Dictionary | Dictionary[]>, datasetIdOrName?: string | undefined) => Promise<void>' is not assignable to type '(args_0: any, ...args_1: unknown[]) => Promise<void>'. Types of parameters 'datasetIdOrName' and 'args_1' are incompatible. Type 'unknown' is not assignable to type 'string | undefined'. 87 await config.onVisitPage({ page, pushData }); ~~~~~~~~ src/config.ts:66:9 66 pushData: z.function().args(z.any()).returns(z.promise(z.void())), ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The expected type comes from property 'pushData' which is declared here on type '{ page: Page; pushData: (args_0: any, ...args_1: unknown[]) => Promise<void>; }' Found 1 error in src/core.ts:87
This is the config I am using to test:
v1.3.0 seems to work fine for me. https://github.com/BuilderIO/gpt-crawler/archive/refs/tags/v1.3.0.zip
from gpt-crawler.
I have the same issue if I update the dependancies with a "npm update/upgrade", otherwise, it works well.
from gpt-crawler.
from gpt-crawler.
Related Issues (20)
- add a method to evaluate the quality of the retrieved context
- Cookies not accepted HOT 1
- Multiple Selectors not Reflected in Output
- Does gpt-crawler server always return same site?
- How to crawl Single Page Application(SPA)
- Can i use Gemini model by google?
- Output.json file not created HOT 1
- How to supply read-able code to the GPT?
- How do I keep links to pictures and videos in my web pages?
- extracting text in hidden div blocks
- cookie example
- how to crawler this site?match not work HOT 1
- add a username and password?
- sh: cross-env: command not found
- PlaywrightCrawler memory problem and errors
- memory usage need to be optimized
- Doesnt Extract Texts present in dropboxes
- Type Error
- Script Not Crawling Subdirectories During Website Scraping
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gpt-crawler.