Bug
universalModuleDefinition?2436:1 Uncaught TypeError: Cannot read property 'Vue' of undefined
Just simply use the surveyjs_vue_quickstart to use surveyjs
@xibman Are you talking about not released yet version (v3.0.0-beta.8) or stable (2.9.x) version?
the released version v3.0.0-rc.3
I've updated vue-cli via the "npm i vue-cli" command and got the 2.9.6 version of the vue-cli
i use npm install -g @vue/cli
thanks for the info
I've just updated node.js to 8.11.3, @vue/cli to v3.0.0-rc.3, cloned the https://github.com/surveyjs/surveyjs_vue_quickstart repo, run "npm i" and run "npm run dev" - everything works ok for me
Am I missing something?
Sorry you missing nothing, is my fault i did not explain all the process.
I think the problem came from webpack.
You use webpack 2 to build surveys js project and the new vue-cli use webpack 4
After investigations we find out that the problem is in the library name :-)
Folder "survey-vue" in "node_modules" with main file "survey.vue.js" is not working,
but folder "survey-vu" in "node_modules" with main file named "survey.vu.js" is working ok :-)
@xibman Can you help us localize the problem with the @vue/cli? What causes the issue - vue-loader or loader plugin or something else...
I will try to find @tsv2013
I have the same kind of problems as @xibman. Will take a look again when surveyjs 1.0.33 is out.
Note that @vue/cli is now at v3.0.0-rc.5 and more updates may be coming soon.
Same problem with latest version of vue-cli and survey-vue
Same here - still doesn't work with the latest versions. Would it be hard to change the problematic filename, if upstream doesn't fix the root cause?
@kamidev we've created an issue in vue/cli repo (see the reference above). We believe that project functionality shouldn't depend on file names.
@dmitrykurmanov I saw your issue and I agree. Let's hope for the best!
Perhaps the ".vue" part of the name is misinterpreted as a file extension? For instance, vue-loader does look for extensions in order to parse Single File Components. That would explain this behavior.
it could be the solution : https://vue-loader.vuejs.org/migrating.html#importing-sfcs-from-dependencies
@xibman Yes, it could. But peolpe should to know it when starting from scratch... It's a kind of magic :-)
Yes, it is an unfortunate kind of magic. :-)
But even @yyx990803 himself says: "*.vue.js is the special file extension used by vue-loader to match against
At present, your repo at https://github.com/surveyjs/vue_cli-_3_boilerplate (updated to the latest vue-cli release candidates) still fails with: 'TypeError: root is undefined'. These are the compilation warnings:
WARNING Compiled with 2 warnings
warning in ./src/App.vue?vue&type=script&lang=js&
"export 'Model' (imported as 'SurveyVue') was not found in 'survey-vue'
warning in ./src/App.vue?vue&type=script&lang=js&
"export 'Survey' (imported as 'SurveyVue') was not found in 'survey-vue'
I have tried various workarounds without success. When updating older projects step-by-step, using vue-loader > 15 always breaks. So far, no activity upstream looks like a possible solution. My guess is that the file extension ".vue.js" will remain problematic in the future.
What steps did you follow when you changed the filename and got this to work? Perhaps I can build myself a local version of surveyjs and use that.
We've decided to make a copy of the survey.vue.js file with the name survey-vue.js and put it in the package as the "main" file. I think it will be done soon, most likely tomorrow, but no promises.
That is excellent news, thank you! I am looking forward to taking the next step with SurveyJS.
We've renamed the file. New file will be available in the nex minor update.
Works like a charm! Thank you.