Can't resolve 'http2' and Cannot read property 'split' of undefined
See original GitHub issueHi, 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:
- Created 3 years ago
- Comments:14 (9 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is awesome! Thanks for making this repo. I think i’m going to make a new module called
openGraphScraperLite
that will useky
for it’s requests. Hopefully that will fix this problem. (This might take me a few days/weeks)ky
docs: https://github.com/sindresorhus/kyOkay. 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.