OP-Engineering/link-preview-js

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

mayank1513 opened this issue · 1 comments

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>
  1. 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):

  • OS: win11
  • Browser: edge
  • Version: Version 103.0.1264.62 (Official build) (64-bit)

Read the readme