Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue is not defined #3

Closed
Sushantshr opened this issue Aug 4, 2018 · 9 comments
Closed

Vue is not defined #3

Sushantshr opened this issue Aug 4, 2018 · 9 comments

Comments

@Sushantshr
Copy link

my main.js
`import Vue from 'vue'
import App from './App'
import router from './router'

window.Vue = require('vue')

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
el: '#app',
router,
components: { App },
template: ''
})`

error:
Uncaught ReferenceError: Vue is not defined

component:
`import { VueFlux, Transitions } from 'vue-flux'
// import './node_modules/vue-flux/dist/vue-flux.css';

export default {
components: {
'vue-flux': VueFlux
},

data: () => ({
fluxOptions: {
autoplay: true
},
fluxImages: [
'https://source.unsplash.com/random',
'https://source.unsplash.com/random',
'https://source.unsplash.com/random'
],
fluxTransitions: {
transitionTurn3d: Transitions.transitionTurn3d
}
})
}`

working in vue cli 3

@d0peCode
Copy link

d0peCode commented Aug 4, 2018

Yes I have same error. Except that css file is missing after i run npm install --save vue-flux. I checked manually that there is no file named vue-flux.css in dist folder inside node_modules/vue-flux.

@ragnarlotus
Copy link
Owner

About the CSS you are right, since I build the code using vue-cli 3 its already included so no need to import it anymore, I will update documentation to remove that.

About Vue not being defined would help a lot if you could share a repo.

@d0peCode
Copy link

d0peCode commented Aug 5, 2018

Error occur in google chrome console repo demo.

@Sushantshr
Copy link
Author

forget about electron just run npm install and npm run dev repo

@ragnarlotus
Copy link
Owner

Thank you, I've been checking it and seems to be some kind of problem in the last build.

Don't worry, in less than a week I'm releasing version 2 with some improvements, more configurable, parallax effect and 1 transition more.

I'll test it again with the repo you gave me.

Thank you!

@Sushantshr
Copy link
Author

have fun coding thank you

@ragnarlotus
Copy link
Owner

Found the issue, was built as web component instead of library so as states in new vue cli 3 was only working when vue imported in html and declared as global.

Last built 2.0.3 is built as library, and is working with your repo.

Let me know if any doubt!

@d0peCode
Copy link

Well I changed to "vue-flux": "^2.0.3" in my package.json and now behaviour is that after around 5 second from page load it throw errors in console:

[Vue warn]: Error in mounted hook: "TypeError: Cannot read property 'split' of undefined"

found in

---> at turn3d.vue
at VueFlux.vue
at src\components\slider.vue
at src\App.vue

TypeError: Cannot read property 'split' of undefined

I also did push this change into my repo demo.

@d0peCode
Copy link

I'll create another issue since I believe that it's not relevant to OP issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants