Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Types Errors #179

Closed
nekochan0122 opened this issue Mar 23, 2023 · 6 comments
Closed

Types Errors #179

nekochan0122 opened this issue Mar 23, 2023 · 6 comments

Comments

@nekochan0122
Copy link

Screenshots

image

image

  • OS: Windows
  • Node Version: 19.7.0
  • openGraphScraper Version: 5.2.2
@wfischer42
Copy link

@nekochan0122, I'm having this exact issue. Were you able to fix it? I assumed it had to do with tsconfig exclude settings, but no config I've tried has worked...

I'm using turborepo and yarn workspaces, so it might have something to do with those for my case.

@jshemas
Copy link
Owner

jshemas commented Mar 24, 2023

Please list the steps to reproduce the problem. (post a code example with your tsconfig)

@wfischer42
Copy link

Ok, it seems to have nothing to do with my tsconfig, and more to do with how this package's types are configured. microsoft/TypeScript#44205

Reproduction steps:

  1. Start a turborepo project (https://turbo.build/repo/docs/getting-started/create-new)
  2. Add open-graph-scraper to /apps/web
  3. Import and call it in an API route
  4. Attempt to build the project

yarn tsc and yarn build fails. Everything works fine if I revert to version 5.0.3 or 4.x.x. (haven't tried other 5.x.x versions, except that it didn't work in 5.1.1, though it threw different errors)

Turborepo uses internal package dependencies via yarn workspaces (or whatever package manager you choose) for things like shared tsconfig files. node_modules is included in the exclude field, but I get a handful of type errors from this package (and only this package) anyway.

@jshemas
Copy link
Owner

jshemas commented Mar 24, 2023

I have no clue what Turborepo is and it only made a front end app for me... So i'm not sure how to reproduce this problem. Please upload a example repo with this problem.

@jshemas
Copy link
Owner

jshemas commented Mar 24, 2023

I believe I have fixed the type issues in open-graph-scraper@5.2.3. Please open a new issue if you have anymore problems.

@nekochan0122
Copy link
Author

@nekochan0122, I'm having this exact issue. Were you able to fix it? I assumed it had to do with tsconfig exclude settings, but no config I've tried has worked...

I didn't fix it, I use cheerio to write my own scrape OG 🤣

image

Repository owner locked as resolved and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants