Ionic Vue编译失败

41zrol4v  于 2022-12-08  发布在  Ionic
关注(0)|答案(2)|浏览(184)

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.
wkftcu5l

wkftcu5l1#

查看错误日志,其中显示:

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

您需要将vue-loader添加到您的webpack配置中。您可以在这里找到这样一个集成的示例:https://github.com/vuejs-templates/webpack-simple
有人在这里说"You may need an appropiate loader to handle this file type" webpack and vue,他解决了这个问题,通过降级vue-loader使用:

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

显然v15有一些问题。
我建议你看看这个帖子:

4dc9hkyq

4dc9hkyq2#

Solved this bug,
One of the components contained lang typescript where as ionic system is using javascript.
SignIn Component:

<script lang="ts">
//logic
</script>

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.

相关问题