Closed Lukkyz closed 8 months ago
Thanks for reporting. How can I reproduce this issue exactly?
And what version of Node.js are you using? This error may occur when using old node.js versions it seems, no clue if you're hitting the same issue though.
I use node 18.18.1
For reproducing :
Create a nuxt project : npx nuxi@latest init <project-name>
npm i json-editor-vue vanilla-jsoneditor
In app.vue or in a page :
<script setup>
import JsonEditorVue from 'json-editor-vue'
let value = ref()
</script>
<template>
<JsonEditorVue
v-model="value"
/>
</template>
I followed your steps, and it just gives a working editor, no errors. Only difference is that I'm running node.js 20.5.0 and Nuxt 3.7.4 with Nitro 2.6.3.
I am getting this error with latest json-editor-vue
and vitepress during build.
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in x\node_modules\vanilla-jsoneditor\package.json imported from x\node_modules\json-editor-vue\dist\json-editor-vue.mjs
Thanks for your input @husayt .
How can I reproduce the issue? Any chance of creating a git repo with a minimal demo of the issue?
@josdejong this has been fixed with latest version of json-editor-vue. FYI, it seems, switching to peerdependency, did the trick.
You can see the change here.
Thank you
👍 that's good to hear. I'll close this issue, assuming the issue of @Lukkyz was the very same. Please reopen if needed.
I want to use vue-json-editor and this json editor is a dependency.. When importing vue-json-editor I have the error :
No "exports" main defined in /home/user/project/node_modules/vanilla-jsoneditor/package.json imported from /home/user/project/node_modules/json-editor-vue/dist/json-editor-vue.mjs
Here is the package.json from vanilla-jsoneditor :My project run on nuxt 3.7.3