foundation icon indicating copy to clipboard operation
foundation copied to clipboard

Prisma Updates, Puppeteer Updates

Open H0r53 opened this issue 4 years ago • 1 comments

Hello, and thank you for providing a great foundation for puppeteer / scraping. It looks like perhaps some of the code provided here is outdated. I'm working through the changes, but I wanted to provide them here for reference and discussion.

First, prisma appears to have updated with breaking changes. A few other packages seem to have updated as well. I updated the package.json to fix these issues.

-    "build:clear": "rm -rf ./build/app/ && mkdir ./build/app/ && echo * >> ./build/app/.gitignore",
+    "build:clear": "rm -rf ./build/app/ && mkdir -p ./build/app/ && echo * >> ./build/app/.gitignore",
-    "db:migrate": "npx prisma format && npx prisma migrate save --name foundation --experimental && npx prisma migrate up --experimental && npx prisma generate",
+    "db:migrate": "npx prisma format && npx prisma migrate dev --name foundation && npx prisma migrate && npx prisma generate",

Second, when running npm run init after making the changes above I eventually receive the following errors:

node_modules/puppeteer-extra/dist/puppeteer.d.ts:4:10 - error TS2305: Module '"puppeteer"' has no exported member 'ChromeArgOptions'.

4 export { ChromeArgOptions } from 'puppeteer';
           ~~~~~~~~~~~~~~~~

node_modules/puppeteer-extra/dist/puppeteer.d.ts:6:10 - error TS2305: Module '"puppeteer"' has no exported member 'FetcherOptions'.

6 export { FetcherOptions } from 'puppeteer';
           ~~~~~~~~~~~~~~

core/browsers/config.ts:128:3 - error TS2322: Type '{ headless: boolean; ignoreHTTPSErrors: boolean; args: string[]; userDataDir: string; defaultViewport: { width: number; height: number; }; }' is not assignable to type 'LaunchOptions'.
  Object literal may only specify known properties, and 'headless' does not exist in type 'LaunchOptions'.

128   headless: env.BROWSER_HEADLESS === "true",

These look like typescript errors related to puppeteer exports. I'm not sure if this repo is maintained but I wanted to mention this here just in case.

Thanks again!

H0r53 avatar May 04 '21 19:05 H0r53

This was really just a prototype for https://masqueradejs.com (which is still in progress) but I'll try sharpen it up when I get a chance :D

prescience-data avatar May 05 '21 22:05 prescience-data