We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
0.8.4
用vue开发kraken项目中涉及fetch请求时,执行npm run build 后,执行 kraken ./dist/js/app.js 报错, 用官网demo 和提供的fetch demo同样报错
flutter: FormatException: Invalid empty scheme (at character 1) :///category ^
#0 _Uri._fail (dart:core/uri.dart:1538:5) #1 new _Uri.notSimple (dart:core/uri.dart:1371:9) #2 Uri.parse (dart:core/uri.dart:956:17) #3 FetchModule._resolveUri (package:kraken/src/module/fetch.dart:35:22) #4 FetchModule.invoke (package:kraken/src/module/fetch.dart:90:15) #5 ModuleManager.invokeModule (package:kraken/src/module/module_manager.dart:65:19) #6 invokeModule (package:kraken/src/bridge/from_native.dart:90:46) #7 _invokeModule (package:kraken/src/bridge/from_native.dart:103:19) #8 _FfiCallback_invokeModule (dart:ffi) #9 FfiTrampoline (dart:ffi) #10 evaluateScripts (package:kraken/src/bridge/to_native.dart:146:21) #11 KrakenBundle.eval (package:kraken/src/launcher/bundle.dart:86:7) #12 KrakenController.evalBundle (package:kraken/src/launcher/controller.dart:721:22) #13 launch._initKrakenApp (package:kraken/src/launcher/launcher.dart:51:22) #14 launch (package:kraken/src/launcher/launcher.dart:72:5)
重现代码 | Code example: const data = { username: 'kraken team', };
fetch('http://example.com/post', { method: 'POST', body: JSON.stringify(data), headers: { 'Content-Type': 'application/json', }, }) .then(function(response) { return response.json(); }) .then(function(data) { // Server post response. console.log(data); });
预期结果 | Expected results:
实际结果 | Actual results:
The text was updated successfully, but these errors were encountered:
看起来是有一个 /category 的请求, 但是 baseUrl 是一个本地路径, 相对于这个路径解析, 所以没有 http 的 scheme
/category
这种情况下需要使用完整 url 请求, 你写的重现代码不是引起报错的代码
Sorry, something went wrong.
看起来是有一个 /category 的请求, 但是 baseUrl 是一个本地路径, 相对于这个路径解析, 所以没有 http 的 scheme 这种情况下需要使用完整 url 请求, 你写的重现代码不是引起报错的代码 git clone https://github.com/openkraken/samples.git cd ./demos/hello-vue 用vue demo 加上fetch请求跑同样会报错,如果去掉fetch请求就没问题,所以才怀疑是否是fetch的影响
这种情况下需要使用完整 url 请求, 你写的重现代码不是引起报错的代码 git clone https://github.com/openkraken/samples.git cd ./demos/hello-vue 用vue demo 加上fetch请求跑同样会报错,如果去掉fetch请求就没问题,所以才怀疑是否是fetch的影响
No branches or pull requests
使用的 Kraken 版本 | What version of kraken are you using
0.8.4
重现步骤 | Steps To Reproduce
用vue开发kraken项目中涉及fetch请求时,执行npm run build 后,执行 kraken ./dist/js/app.js 报错, 用官网demo 和提供的fetch demo同样报错
flutter: FormatException: Invalid empty scheme (at character 1)
:///category
^
#0 _Uri._fail (dart:core/uri.dart:1538:5)
#1 new _Uri.notSimple (dart:core/uri.dart:1371:9)
#2 Uri.parse (dart:core/uri.dart:956:17)
#3 FetchModule._resolveUri (package:kraken/src/module/fetch.dart:35:22)
#4 FetchModule.invoke (package:kraken/src/module/fetch.dart:90:15)
#5 ModuleManager.invokeModule (package:kraken/src/module/module_manager.dart:65:19)
#6 invokeModule (package:kraken/src/bridge/from_native.dart:90:46)
#7 _invokeModule (package:kraken/src/bridge/from_native.dart:103:19)
#8 _FfiCallback_invokeModule (dart:ffi)
#9 FfiTrampoline (dart:ffi)
#10 evaluateScripts (package:kraken/src/bridge/to_native.dart:146:21)
#11 KrakenBundle.eval (package:kraken/src/launcher/bundle.dart:86:7)
#12 KrakenController.evalBundle (package:kraken/src/launcher/controller.dart:721:22)
#13 launch._initKrakenApp (package:kraken/src/launcher/launcher.dart:51:22)
#14 launch (package:kraken/src/launcher/launcher.dart:72:5)
重现代码 | Code example:
const data = {
username: 'kraken team',
};
fetch('http://example.com/post', {
method: 'POST',
body: JSON.stringify(data),
headers: {
'Content-Type': 'application/json',
},
})
.then(function(response) {
return response.json();
})
.then(function(data) {
// Server post response.
console.log(data);
});
预期结果 | Expected results:
实际结果 | Actual results:
The text was updated successfully, but these errors were encountered: