Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

运行 hello-vue demo 报错 #1241

Closed
nne998 opened this issue Mar 24, 2022 · 4 comments
Closed

运行 hello-vue demo 报错 #1241

nne998 opened this issue Mar 24, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@nne998
Copy link

nne998 commented Mar 24, 2022

环境

$ flutter doctor -v
[✓] Flutter (Channel stable, 2.10.3, on macOS 12.3 21E230 darwin-x64, locale zh-Hans-CN)
    • Flutter version 2.10.3 at /Users/tony/fvm/versions/stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7e9793dee1 (3 weeks ago), 2022-03-02 11:23:12 -0600
    • Engine revision bd539267b4
    • Dart version 2.16.1
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/tony/Library/Android/sdk
    • Platform android-32, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)

[✓] VS Code (version 1.65.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.36.0

[✓] Connected device (1 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 99.0.4844.83

[✓] HTTP Host Availability
    • All required HTTP hosts are available

编译成功

$ npm run build
  File              Size                                                         Gzipped

  dist/js/app.js    799.14 KiB                                                   170.31 KiB

  Images and other types of assets omitted.

 DONE  Build complete. The dist directory is ready to be deployed.
 INFO  Check out deployment instructions at https://cli.vuejs.org/guide/deployment.html

运行出错

$ kraken ./dist/js/app.js

Execute binary: /Users/tony/.nvm/versions/node/v12.22.7/lib/node_modules/@openkraken/cli/build/darwin/debug/app.app/Contents/MacOS/app 

flutter: Observatory listening on http://127.0.0.1:50444/6gSmCVKfDAg=/
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Invalid argument(s): No host specified in URI /Users/tony/Library/Mobile%20Documents/com~apple~CloudDocs/yunpan/code/kraken_projects/samples/demos/hello-vue/dist/js/app.js
#0      _HttpClient._openUrl (dart:_http/http_impl.dart:2662:9)
#1      _HttpClient.openUrl (dart:_http/http_impl.dart:2568:7)
#2      ProxyHttpClientRequest._createBackendClientRequest (package:kraken/src/foundation/http_client_request.dart:238:64)
#3      ProxyHttpClientRequest.close (package:kraken/src/foundation/http_client_request.dart:226:23)
#4      NetworkAssetBundle.load (package:kraken/src/launcher/bundle.dart:224:55)
<asynchronous suspension>
#5      NetworkBundle.resolve (package:kraken/src/launcher/bundle.dart:181:17)
<asynchronous suspension>
#6      KrakenController.loadBundle (package:kraken/src/launcher/controller.dart:1142:7)
<asynchronous suspension>
#7      _KrakenRenderObjectElement.mount (package:kraken/src/widget/kraken.dart:999:5)
<asynchronous suspension>

flutter: Kraken DevTool listening at ws://192.168.40.27:9222
flutter: Open Chrome/Edge and enter following url to your navigator:
flutter:     devtools://devtools/bundled/inspector.html?ws=192.168.40.27:9222

仅显示了空白窗口
WX20220324-181533@2x

@nne998 nne998 added the bug Something isn't working label Mar 24, 2022
@answershuto
Copy link
Member

我瞅瞅

@answershuto
Copy link
Member

kraken cli 起本地文件似乎有问题。 @andycall

可以先用本地起服务的方式打开。

npm run serve
kraken http://localhost:8080/app/index.js

image

@wssgcg1213
Copy link
Member

fromUrl 本地路径需要带 file: 协议, cli 里面没有指定协议所以有当成网络加载了 @answershuto

@wssgcg1213
Copy link
Member

wssgcg1213 commented Mar 28, 2022

已经发布了新版本的 cli 修复此问题,重新安装 cli 即可

npm i @openkraken/cli -g

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants