Vue-cli: Doesn't work with survey-vue https://www.npmjs.com/package/survey-vue

Created on 18 Jul 2018  路  7Comments  路  Source: vuejs/vue-cli

Version

3.0.0-rc.3

Reproduction link

https://github.com/surveyjs/vue_cli-_3_boilerplate

Steps to reproduce

just run npm run serve and open the console

What is expected?

console without error

What is actually happening?

In fact the problem with our main file name survey.vue.js (https://unpkg.com/[email protected]/survey.vue.js)

For example if we rename survey.vue.js to survey-vue.js it will be ok.


I am one of SurveyJS contributors. Please look at the original issue reference https://github.com/surveyjs/surveyjs/issues/1223

bug

All 7 comments

Sounds a bit like the webpack alias that we use for 'vue$' could be the culprit, but on the other hand, I maintain a package called portal-vue which doesn't have this problem...

@LinusBorg yes, I think that the problem only in the dot (".vue")

@LinusBorg the file name survey-vue.js is working also, but the problem is with the survey.vue.js

This is a really weird one. I did some debugging as far as I could.

  • It's not the alias, I manually added another alias for survey-vue before the original vue$ one but that didn't solve anything
  • I also had a suspicion that vue-loader's dynamically added rules were responsible, which rely on resourceQuery filtering where it adds a "fake file" (see here), but then I removed the App.vue entirely and imported SurveyVue into main.js, so those rules won't apply - no more "can't find import Survey..." errors, but an error about Vue not being found.

Now I'm a bit out of my whits ... /ping @yyx990803

*.vue.js is the special file extension used by vue-loader to match against <script> blocks in *.vue files... for now you should just rename it. We can probably work around this in vue-loader.

Edit: not 100% sure if that's related.

Survey-vue has now renamed the main file to 'survey-vue.js', which fixes the reported problem.

However, if "*.vue.js" really is a special file exension (and "off-limits" for non-Vue use), perhaps the documentation can be more clear about this?

I'm, closing this here as it has to be solved in vue-loader, if anywhere.

Was this page helpful?
0 / 5 - 0 ratings