question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't resolve 'http2' and Cannot read property 'split' of undefined

See original GitHub issue

Hi, I’m running into some issues using this package. I’m running yarn add open-graph-package and in the code I have:

import OpenGraph from 'open-graph-scraper'

const url = "https://www.test.com"
const options = { url: url }

OpenGraph(options, (error, results, response) => {
  console.log("error:", error)
  console.log("results:", results)
  console.log("response:", response)
})

and I get the following error:

./node_modules/http2-wrapper/source/index.js
Module not found: Can't resolve 'http2' in '/Users/taylorwong/Documents/GitHub/client-dashboard/node_modules/http2-wrapper/source'

I installed http2 with yarn add http2 but then run into the following error:

TypeError: Cannot read property 'split' of undefined
node_modules/@szmarczak/http-timer/dist/source/index.js:4

Let me know if I can provide any additional information to help with this. Thank you!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

9reactions
jshemascommented, Aug 20, 2020

This is awesome! Thanks for making this repo. I think i’m going to make a new module called openGraphScraperLite that will use ky for it’s requests. Hopefully that will fix this problem. (This might take me a few days/weeks)

ky docs: https://github.com/sindresorhus/ky

3reactions
jshemascommented, Dec 13, 2020

Okay. I made a new lib here -> https://github.com/jshemas/openGraphScraperLite and forked the example vue project here -> https://github.com/jshemas/vue-opengraph

I keep getting a bunch of CORS errors, but I think I’m getting really close to getting this to work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot Read Property 'split' of Undefined - freeCodeCamp
it will throw the TypeError: Cannot read property 'split' of undefined error. The split method. When split is called on a string, it...
Read more >
Cannot read property 'split' of undefined in discord and nodejs ...
If the erorr is saying "cannot read property anyProperty of undefined" then that means that the value which you're asking for a property...
Read more >
How to prevent cannot read property split of ... - Meticulous
The error "Cannot read property split of undefined" can occur when performing any of these types of operations if the variable is undefined....
Read more >
How to Prevent cannot read property split of ... - Gopi Gorantala
To solve this error, make sure you call split() method only on strings. The best way to check whether a variable is of...
Read more >
cannot read properties of undefined (reading 'split') mongoose
Apparently the TypeError: Cannot read properties of undefined (reading 'Token') is happening because the code is executing on the client side when it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found