Getting "`abort_controller_1.default` is not a constructor" error - Trying to use with Nuxt 3.
mayank1513 opened this issue · 1 comments
mayank1513 commented
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:
- Create nuxt 3 app
- `pnpm i link-preview-js
- 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>
- 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)
ospfranco commented
Read the readme