Replies: 5 comments 1 reply
-
|
I'd feel it's the env you use does not support postinstall hook, maybe try |
Beta Was this translation helpful? Give feedback.
-
|
StackBlitz: It indeed looks like the CodeSandbox: I'm confused as to how it would work in CodeSandbox for Vue 3, but not Vue 2. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
I'm trying to make a demo for my library using |
Beta Was this translation helpful? Give feedback.
-
|
Managed to get it working on a nuxt container which have access to terminal |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
For some reason, Vuelidate's
useVuelidate()function crashes onvue-demi'sgetCurrentInstance(), but only in Codesandbox (with Vue 2 only) and StackBlitz (any version of Vue).I initially opened a Vuelidate issue, but they punted to
vue-demi.Following the guide for using Vuelidate with Composition API, I'm seeing an error when
useVuelidate()is called:This seems to occur only in Codesandbox or StackBlitz. Running the same code in a Vue CLI scaffolded project works fine.
Stack trace
index.js:27 TypeError: (0 , $csb__vuedemi.getCurrentInstance) is not a function at useVuelidate (index.esm.js:580) at setup (App.vue:32) at mergedSetupFn (vue-composition-api.esm.js:1957) at eval (vue-composition-api.esm.js:1770) at activateCurrentInstance (vue-composition-api.esm.js:1708) at initSetup (vue-composition-api.esm.js:1769) at VueComponent.wrappedData (vue-composition-api.esm.js:1756) at getData (vue.common.dev.js:4754) at initData (vue.common.dev.js:4711) at initState (vue.common.dev.js:4650) at VueComponent.Vue._init (vue.common.dev.js:5010) at new VueComponent (vue.common.dev.js:5157) at createComponentInstanceForVnode (vue.common.dev.js:3307) at init (vue.common.dev.js:3136) at createComponent (vue.common.dev.js:6013) at createElm (vue.common.dev.js:5960) at Vue.patch [as __patch__] (vue.common.dev.js:6549) at Vue._update (vue.common.dev.js:3957) at Vue.updateComponent (vue.common.dev.js:4078) at Watcher.get (vue.common.dev.js:4490) at new Watcher (vue.common.dev.js:4479) at mountComponent (vue.common.dev.js:4085) at Vue.$mount (vue.common.dev.js:9084) at Vue.$mount (vue.common.dev.js:11989) at evaluate (main.js? [sm]:9) at V (eval.js:42) at ee.evaluate (transpiled-module.js:699) at ge.evaluateTranspiledModule (manager.js:297) at ge.evaluateModule (manager.js:268) at compile.ts:728 at c (runtime.js:45) at Generator._invoke (runtime.js:274) at Generator.forEach.t. [as next] (runtime.js:97) at r (asyncToGenerator.js:3) at u (asyncToGenerator.js:25)Reproduction URL
https://codesandbox.io/s/usevuelidate-bug-getcurrentinstance-is-not-a-function-6rx9w
or
https://stackblitz.com/edit/vuelidate-bug-demo
To Reproduce
Steps to reproduce the behavior:
Create new Codesandbox for Vue 2 (or fork Vuelidate's official Vue 3 + Composition API Starter and switch Vue version to 2.x).
Add dependency for
@vue/composition-api, and install it frommain.js:Open
src/App.vue, and copy Vuelidate guide's example code for the Composition API usage:See error in browser console
Expected behavior
The same output from Vuelidate's official Vue 3 + Composition API Starter.
Screenshots

Additional context
vue2.6.14@vue/composition-api1.0.0-rc.11@vuelidate/core2.0.0-alpha.14 (also newer versions, including 2.0.0-alpha.19)@vuelidate/validators2.0.0-alpha.12 (also newer versions, including 2.0.0-alpha.17)Beta Was this translation helpful? Give feedback.
All reactions