You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With "moduleResolution": "NodeNext" in tsconfig.json, typescript incorrectly assumes the type of exports of @tinymce/tinymce-vue.
This works at runtime but doesn't compile:
<script setup lang="ts">
importEditorfrom'@tinymce/tinymce-vue';
</script>
<template>
<Editor />
<!-- Type '{}' is not assignable to type 'ComponentProps<typeof import("node_modules/@tinymce/tinymce-vue/lib/cjs/main/ts/index")>' -->
</template>
The way I managed to fix it is to patch @tinymce/tinymce-vue's package.json with "type": "module", so typescript knows to treat it as an es module. But I'm not sure if that's a proper solution, since I'm still trying to wrap my head around this whole typescript node esm disaster.
The text was updated successfully, but these errors were encountered:
src/App.vue:6:6 - error TS2345: Argument of type '{}' is not assignable to parameter of type 'typeof import(".../node_modules/@tinymce/tinymce-vue/lib/cjs/main/ts/index")'.
Property 'Editor' is missing in type '{}' but required in type 'typeof import(".../node_modules/@tinymce/tinymce-vue/lib/cjs/main/ts/index")'.
6 <Editor />
~~~~~~
node_modules/@tinymce/tinymce-vue/lib/cjs/main/ts/index.d.ts:9:1
9 export default Editor;
~~~~~~~~~~~~~~~~~~~~~~
'Editor' is declared here.
Found 1 error in src/App.vue:6
With
"moduleResolution": "NodeNext"
intsconfig.json
, typescript incorrectly assumes the type of exports of@tinymce/tinymce-vue
.This works at runtime but doesn't compile:
This compiles but breaks at runtime:
This works, but requires a dynamic import:
The way I managed to fix it is to patch
@tinymce/tinymce-vue
'spackage.json
with"type": "module"
, so typescript knows to treat it as an es module. But I'm not sure if that's a proper solution, since I'm still trying to wrap my head around this whole typescript node esm disaster.The text was updated successfully, but these errors were encountered: