gpt4 book ai didi

javascript - TipTap 和 Nuxt - 无法从非 EcmaScript 模块导入命名导出 '{module}'

转载 作者:行者123 更新时间:2023-11-28 03:14:32 27 4
gpt4 key购买 nike

我正在尝试使用 TipTapNuxt但似乎无法弄清楚为什么它不起作用。我已经阅读了存储库上的问题并使用了他们的建议,但我只是收到这些错误:

ERROR  in /Volumes/Projects/nuxt/candy-hub-lerna/node_modules/prosemirror-state/dist/index.mjs
Can't import the named export 'ReplaceStep' from non EcmaScript module (only default export is available)

ERROR in /Volumes/Projects/nuxt/candy-hub-lerna/node_modules/prosemirror-view/dist/index.mjs
Can't import the named export 'Selection' from non EcmaScript module (only default export is available)

ERROR in /Volumes/Projects/nuxt/candy-hub-lerna/node_modules/prosemirror-transform/dist/index.mjs
Can't import the named export 'Slice' from non EcmaScript module (only default export is available)

设置
我的设置非常简单,并且回响 this github issue

/components/forms/RichText.vue
<template>
<no-ssr>
<editor-content :editor="editor" />
</no-ssr>
</template>

<script>
import { Editor, EditorContent } from 'tiptap'

export default {
components: {
EditorContent
},
data () {
return {
editor: null
}
},
mounted () {
this.editor = new Editor({
content: '<p>This is just a boring paragraph</p>'
})
},
beforeDestroy () {
// Always destroy your editor instance when it's no longer needed
this.editor.destroy()
}
}
</script>
/components/global/LocalisedAttributes.vue
<template>
<div>
<rich-text />
</div>
</template>

<script>
import RichText from '~/components/forms/RichText.vue'

export default {
components: {
RichText
}
}
</script>

我尝试将“prosemirror-view”和“tiptap”添加到 nuxt.config.js 中的 build.transpile 数组中,但没有任何效果。

如果有人能在 Nuxt 上运行它,我将不胜感激对他们的设置有任何见解。

最佳答案

看起来这是 Lerna 的问题,我已切换到 yarn 工作区,现在一切似乎正常!

关于javascript - TipTap 和 Nuxt - 无法从非 EcmaScript 模块导入命名导出 '{module}',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59754278/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com