如果没有 --bundle 选项,Nativescript-vue 将无法工作

Nativescript-vue doesn't work without --bundle option

请让我知道我可以提供哪些信息以更好地帮助解决此问题。截至目前,我一直在阅读 webpack,比较我的 webpack.config.js 文件,并随机搜索 Google void.

今天早上早些时候,我 运行 正在按预期设置我的 NativeScript-vue 项目。进行了一些更改、保存、测试、洗涤、冲洗重复。然后我尝试构建并收到以下错误消息:

Unable to apply changes on device: emulator-####. Error is: Nativescript-vue doesn't work without --bundle option. Please specify --bundle option to the command and execute it again..

我一直在一个 .vue 文件中进行编辑 -- 我没有修改任何其他文件,尤其是配置文件。

是什么导致了这个问题?
我该如何解决这个问题?
有没有比粘贴错误消息更智能的搜索?

更新:

根据@Estradiaz 的要求

我一直在尝试 运行 应用程序:
tns run android --bundle
(也尝试使用 ios 并得到相同的结果)

我已经使用 npm installtns install

构建了项目

我的 package.json 中唯一的脚本是:

"clean": "rm -rf node_modules/* && rm -rf hooks/* && rm -rf platforms/* && rm webpack.config.js && rm package-lock.json"

(只是为了核实一切 if/when 正在添加新资产)

运行 TNS 版本#5.2.4

终端的输出是:

Webpack compilation complete. Watching for file changes.
Webpack build done!
Unable to apply changes on device: emulator-5554. Error is: Nativescript-vue doesn't work without --bundle option. Please specify --bundle option to the command and execute it again..

更新更新:

Estradiaz 掉落了一些伟大的知识;然而,当我的 nativescript-vue 包从 2.0.2

更新到 2.1.0 时,我的错误被发现了

回滚到 2.0.2 解决了我的具体问题。其他开发者已开始报告类似问题:https://github.com/nativescript-vue/nativescript-vue/issues/454 and https://github.com/nativescript-vue/nativescript-vue/pull/361#issuecomment-474079850

搜索打字错误

the bugging history of code ;)

如果不更改开发依赖项,"--bundle" 错误的主要原因是使用了非本机元素 - 例如Lable 而不是 Label.

以下:

$ npm install -g @vue/cli @vue/cli-init
$ vue init nativescript-vue/vue-cli-template <project-name>
$ cd <project-name>
$
$ npm install
$ # or
$ yarn install
$
$ tns run android --bundle
$ # or
$ tns run ios --bundle

来自:Quick Start

然后 - 同时 运行 - 对 ./app/components/App.vue 进行更改:

<template>
    <Page>
        <ActionBar title="Welcome to NativeScript-Vue!"/>
        <GridLayout columns="*" rows="*">
            <Label class="message" :text="msg" col="0" row="0"/>

        </GridLayout>
    </Page>
</template>

到 (html: div):

<template>
    <Page>
        <ActionBar title="Welcome to NativeScript-Vue!"/>
        <GridLayout columns="*" rows="*">

            <div id="hello"></div>
        </GridLayout>
    </Page>
</template>

或(打字错误:Lable 而不是 Label):

<template>
    <Page>
        <ActionBar title="Welcome to NativeScript-Vue!"/>
        <GridLayout columns="*" rows="*">
            <Lable class="message" :text="msg" col="0" row="0"/>

        </GridLayout>
    </Page>
</template>

一个人会收到以下错误:

Webpack compilation complete. Watching for file changes. Webpack build done!

Unable to apply changes on device: emulator-5554. Error is: Nativescript-vue doesn't work without --bundle option. Please specify --bundle option to the command and execute it again..

经过一些故障排除(以及技术负责人的帮助),我们今天找到了一个新的 nativescript-vue package was released(从 2.0.2 到 2.1.0)。

也就是说,"feature" #361是:"show error when --bundle option is not provided"

我不知道这在我的项目范围内究竟意味着什么,也不知道我是如何调用构建的,也不知道它为什么会崩溃……但回滚到 2.0.2 解决了我的问题。

nativescript-vue 今天 (2.1.0) 的版本有问题,这导致了您遇到的问题。我们已发布 2.2.0 修复程序,因此请确保您是 运行 最新版本。