简体   繁体   中英

Ionic Vue failed to compile

I was running ionic serve in local computer and got following error

compilation error

It was working fine earlier, also I didn't make any changes to code whatsoever. I don't understand what is causing this error.

I tried following

  1. Freshly clone project from git repo
  2. Re-install npm dependencies
  3. Un-install and re-install ionic globally

None of the above methods worked.

Looking at the error log, which say:

You may need an appropriate loader to handle this file type.

You need to add vue-loader to your webpack configuration. You can find an example of such an integration here: https://github.com/vuejs-templates/webpack-simple

Someone said here "You may need an appropiate loader to handle this file type" webpack and vue that he solved the problem by downgrading vue-loader using:

npm install vue-loader@14 --save-dev.

Apparently v15 has some issues.

I suggest you to look in this posts:

Solved this bug,

One of the components contained lang typescript where as ionic system is using javascript.

SignIn Component: script lang="ts"

I just removed lang and ionic compiled files properly.

Earlier versions didn't track this error.I recently upgraded ionic version to 6.17.1.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM