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

open-graph-scraper > 4.11.1 jest and supertest segfault #162

Closed
alexng353 opened this issue Feb 6, 2023 · 3 comments
Closed

open-graph-scraper > 4.11.1 jest and supertest segfault #162

alexng353 opened this issue Feb 6, 2023 · 3 comments

Comments

@alexng353
Copy link

alexng353 commented Feb 6, 2023

See the recreation repository here

Below is the pasted readme which should contain all the necessary information.

ogs-bug-example

Description

A repostiory to demonstrate a bug in the open-graph-scraper package above the version 4.11.1.

Steps to reproduce

  1. Clone this repository
  2. Run yarn
  3. Run yarn test
  4. Watch the program segfault

Expected behavior

The program should not segfault.

Actual behavior

The program segfaults.

image

Notes

If you start the server with yarn start and just go to http://localhost:3555, the code doesn't segfault. It only segfaults when you run the test.

I'm not sure if this means that supertest or jest is at fault, but I'm submitting an issue anyways.

Environment

  • Node.js version: v18.14.0 via nvs
  • OS: Ubuntu 22.04 WSL via Windows 11 pro 22h2 2261.1105
  • open-graph-scraper version: 5.0.5
  • jest version: 29.4.1
  • supertest version: 6.3.3
  • typescript version: 4.9.5

Additional info

Installing open-graph-scraper 4.11.1 and running the test will not segfault. See branch 4.11.1

@jshemas
Copy link
Owner

jshemas commented Feb 7, 2023

Hello,

Thanks for making a test repo, that really help with debugging this issue. It looks like the problem is with the dynamic import for got because openGraphScraper is using CommonJS. I believe this issue is related to this and this.

Have you try using a different test runner?

@alexng353
Copy link
Author

No, I have not tried using a different test runner. I've just cloned my test repo to codespaces, I'm gonna heck around until I find out. Thanks so much for the help @jshemas.

P.S. This is my first time making issues, is there anything that you'd like to give me feedback on? Thanks so much in advance.

@jshemas
Copy link
Owner

jshemas commented Feb 10, 2023

I don't have any feedback for you but I did really appreciate the working example of the problem!

@jshemas jshemas closed this as completed Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants