I get the following error.
index.ts:51 Uncaught (in promise) TypeError: url_1.URL is not a constructor at getPage (index.ts:51:17) at unfurl (index.ts:42:10) at getLinkMetaData (LinkPreview.tsx:13:34) at LinkPreview.tsx:16:9 at commitHookEffectListMount (react-dom.development.js:23150:26) at commitPassiveMountOnFiber (react-dom.development.js:24926:13) at commitPassiveMountEffects_complete (react-dom.development.js:24891:9) at commitPassiveMountEffects_begin (react-dom.development.js:24878:7) at commitPassiveMountEffects (react-dom.development.js:24866:3) at flushPassiveEffectsImpl (react-dom.development.js:27039:3)
Included screenshots below. "URL" shows undefined in the chrome inspector in the callback.
I've tried messing around with node versions based on the issue #92 . I think it's the wrong path. If it wasn't for the fact that I can reproduce it in codesandbox too (see link above), I wouldn't be logging the issue. Reaching out to see if anyone else has seen this or it's a legitimate issue.
Seeing an issue while trying the package in my React, TypeScript environment. It can be reproduced at codesandbox.io - https://codesandbox.io/s/optimistic-liskov-36c96s?file=/App.js
In a nutshell I installed via npm i unfurl.js. Here's the code I'm testing. ` import { unfurl } from "unfurl.js"; import { useEffect } from "react";
function App() { const previewLink = "https://www.yahoo.com"; useEffect(() => { const getLinkMetaData = async () => { const result = await unfurl(previewLink); console.log(result.title); }; getLinkMetaData(); }, []); return <>hello world!</>; } export default App; `
I get the following error.
index.ts:51 Uncaught (in promise) TypeError: url_1.URL is not a constructor at getPage (index.ts:51:17) at unfurl (index.ts:42:10) at getLinkMetaData (LinkPreview.tsx:13:34) at LinkPreview.tsx:16:9 at commitHookEffectListMount (react-dom.development.js:23150:26) at commitPassiveMountOnFiber (react-dom.development.js:24926:13) at commitPassiveMountEffects_complete (react-dom.development.js:24891:9) at commitPassiveMountEffects_begin (react-dom.development.js:24878:7) at commitPassiveMountEffects (react-dom.development.js:24866:3) at flushPassiveEffectsImpl (react-dom.development.js:27039:3)
Included screenshots below. "URL" shows undefined in the chrome inspector in the callback.
I've tried messing around with node versions based on the issue #92 . I think it's the wrong path. If it wasn't for the fact that I can reproduce it in codesandbox too (see link above), I wouldn't be logging the issue. Reaching out to see if anyone else has seen this or it's a legitimate issue.
Thanks for the time.