OP-Engineering / link-preview-js

⛓ Extract web links information: title, description, images, videos, etc. [via OpenGraph], runs on mobiles and node.
MIT License
770 stars 124 forks source link

Getting "`abort_controller_1.default` is not a constructor" error - Trying to use with Nuxt 3. #125

Closed mayank1513 closed 2 years ago

mayank1513 commented 2 years ago

Describe the bug Getting "abort_controller_1.default is not a constructor" error - Trying to use with Nuxt 3. Tried both with async await and .then calls.

To Reproduce Steps to reproduce the behavior:

  1. Create nuxt 3 app
  2. `pnpm i link-preview-js
  3. import and use getLinkPreview method
    <script setup>
    import { getLinkPreview } from "link-preview-js";
    onMounted(() => {
    getLinkPreview("https://www.youtube.com/watch?v=MejbOFk7H6c").then((data) =>
    console.debug({ data })
    );
    });
    </script>
  4. See error

    index.js:352 
    
       Uncaught (in promise) TypeError: abort_controller_1.default is not a constructor
    at index.js:352:34
    at step (index.js:33:23)
    at Object.next (index.js:14:53)
    at index.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (index.js:4:12)
    at getLinkPreview (index.js:325:12)
    at index.vue:4:1
    at callWithErrorHandling (runtime-core.esm-bundler.js:155:22)
    at callWithAsyncErrorHandling (runtime-core.esm-bundler.js:164:21)

Expected behavior Data corresponding to the URL should be returned.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

ospfranco commented 2 years ago

Read the readme