Closed shufangyi closed 3 years ago
Can't open your example link, maybe is private, do you mind making it public?
My mis! Now its public! @pikax
After talking with @patak-js this issue can be solved by adding dedup
to vite.config
import path from "path";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import vueJsx from "@vitejs/plugin-vue-jsx";
import pages from "vite-plugin-pages";
// https://vitejs.dev/config/
export default defineConfig({
resolve: {
dedupe: ["vue"], // dedup vue
alias: {
"@": path.resolve(__dirname, "src"),
},
},
plugins: [
vue(),
// options are passed on to @vue/babel-plugin-jsx
vueJsx({}),
pages({
syncIndex: false,
extensions: ["vue", "ts"],
}),
],
});
Sometimes there are issues though if there are duplicated copies of the same dep, and you need to explicitely dedupe them.
I have tried the configure dedupe: ["vue"]
.
Somehow it doesnot work...😢
That's odd, I've this working here: vite-vue-show-vue-composable-error.zip
I've deleted the node_modules
and try it again, and couldn't see the error, do you mind try it again?
I downloaded the zip file you provided.
Same here.
Tried the example @pikax provided and it can render the page correctly but once I drag any item this throws:
vue.runtime.esm-bundler.js:1 Uncaught ReferenceError: nextTick is not defined
at Object.nextTick (vue.runtime.esm-bundler.js:1)
at Proxy._emit (vuedraggable.js:14)
at Sortable.<anonymous> (vuedraggable.js:29)
at dispatchEvent (sortable.esm.js:916)
at _dispatchEvent (sortable.esm.js:961)
at Sortable._dragStarted (sortable.esm.js:1570)
Just putting this here as a followup. I was running into the issue as I think it was similar to what's being reported here. Or maybe it's related to the dedupe vite fix. Anyways, I was trying to get vue-composable to work in yarn workspace (monorepo) and was running into the error. Eventually I fixed it by installing @next which looks like it's 1.0.0-alpha.37
I'm not sure why that worked and beta.37 doesn't. I'm more then happy to provide any sort of testing or lookup into this. I just thought it was strange that upgrading to that version seemed to fix my issue.
../node_modules/vue-composable/dist/vue-composable.esm-bundler.js:1:120: error: Could not resolve "@vue/composition-api" (mark it as external to exclude it from the bundle)```
In [vue-composable.esm-bundler.js]
if change
to
then
this error will be solved!
example 👉 link