HarmonyOS smartwatch import system things error - harmonyos

https://developer.harmonyos.com/en/docs/documentation/doc-references/js-apis-network-uploading-downloading-0000000000626076
I trying to import system things:
import network from '#system.network';
import vibrator from '#system.vibrator';
import request from '#system.request';
console.log("vibrator? " + vibrator);
console.log("network? " + network);
console.log("request? " + request);
[Debug] vibrator? [object Object] //working, found
[Debug] network? undefined //can't find
[Debug] request? undefined //can't find
7:58 Jerry Launcher: [JS Exception]: TypeError: Cannot read property 'download' of undefined
8:02 Jerry Launcher: [JS Exception]: TypeError: Cannot read property 'download' of undefined
Whats happening?

Related

I get the following error when i build my project in flutter

C:\Users\Faheem\Desktop\dashboard>flutter build apk --profile
Building with sound null safety
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/storage.dart:2:8: Error: Not found: 'dart:html'
import 'dart:html';
^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core_web-1.6.2/lib/firebase_core_web.dart:9:8: Error: Not found: 'dart:html'
import 'dart:html';
^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-3.3.13/lib/src/firebase_auth_web_recaptcha_verifier_factory.dart:7:8: Error: Not found: 'dart:html'
import 'dart:html';
^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/utils.dart:2:8: Error: Not found: 'dart:html'
import 'dart:html';
^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core_web-1.6.2/lib/firebase_core_web.dart:10:8: Error: Not found: 'dart:js'
import 'dart:js';
^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.3/lib/js.dart:8:1: Error: Not found: 'dart:js'
export 'dart:js' show allowInterop, allowInteropCaptureThis;
^
/C:/flutter/packages/flutter_web_plugins/lib/src/navigation/js_url_strategy.dart:13:8: Error: Not found: 'dart:html'
import 'dart:html' as html;
^
/C:/flutter/packages/flutter_web_plugins/lib/src/navigation/url_strategy.dart:6:8: Error: Not found: 'dart:html'
import 'dart:html' as html;
^
/C:/flutter/packages/flutter_web_plugins/lib/src/navigation/utils.dart:5:8: Error: Not found: 'dart:html'
import 'dart:html';
^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.3/lib/js_util.dart:8:1: Error: Not found: 'dart:js_util'
export 'dart:js_util';
^
/C:/flutter/packages/flutter_web_plugins/lib/src/navigation/js_url_strategy.dart:79:48: Error: Type 'html.EventListener' not found.
external ui.VoidCallback addPopStateListener(html.EventListener fn);
^^^^^^^^^^^^^^^^^^
/C:/flutter/packages/flutter_web_plugins/lib/src/navigation/url_strategy.dart:194:3: Error: Type 'html.Location' not found.
html.Location get _location => html.window.location;
^^^^^^^^^^^^^
/C:/flutter/packages/flutter_web_plugins/lib/src/navigation/url_strategy.dart:196:3: Error: Type 'html.History' not found.
html.History get _history => html.window.history;
^^^^^^^^^^^^
/C:/flutter/packages/flutter_web_plugins/lib/src/navigation/url_strategy.dart:199:28: Error: Type 'html.EventListener' not found.
void addPopStateListener(html.EventListener fn) {
^^^^^^^^^^^^^^^^^^
/C:/flutter/packages/flutter_web_plugins/lib/src/navigation/url_strategy.dart:204:31: Error: Type 'html.EventListener' not found.
void removePopStateListener(html.EventListener fn) {
^^^^^^^^^^^^^^^^^^
/C:/flutter/packages/flutter_web_plugins/lib/src/navigation/utils.dart:7:7: Error: Type 'AnchorElement' not found.
final AnchorElement _urlParsingNode = AnchorElement();
^^^^^^^^^^^^^
/C:/flutter/packages/flutter_web_plugins/lib/src/navigation/utils.dart:20:7: Error: Type 'Element' not found.
final Element? _baseElement = document.querySelector('base');
^^^^^^^
../../runtime/vm/zone.cc: 94: error: Out of memory.
version=2.16.2 (stable) (Tue Mar 22 13:15:13 2022 +0100) on "windows_x64"
pid=3640, thread=8308, isolate_group=main(00000000053F0BE0), isolate=(nil)(0000000000000000)
isolate_instructions=3e90000, vm_instructions=7ff6304d5460
pc 0x00007ff6306dd222 fp 0x000000000a36eb20 Dart_IsPrecompiledRuntime+0x21cd22
-- End of DumpStackTrace
=== Crash occured when compiling package:front_end/src/fasta/kernel/hierarchy/hierarchy_node.dart_ClassHierarc* What went wrong:
Execution failed for task ':app:compileFlutterBuildProfile'.
Process 'command 'C:\flutter\bin\flutter.bat'' finished with non-zero exit value 1
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
Try these commands:
flutter clean
flutter packages get
dart pub get
If this doesn't solve your problem, I recommend starting a new project and moving your code and pubspec.yaml files there.

Firebase Deploy Error 'Route.post() requires a callback function but got a [object undefined]?

I am getting this error when Firebase deploy in terminal. I can't find any of my code with Route.post() in. It looks like it s being called from a module ...
i deploying functions
i functions: ensuring necessary APIs are enabled...
✔ functions: all necessary APIs are enabled
i functions: preparing functions directory for uploading...
Error: Error occurred while parsing your function triggers.
Error: Route.post() requires a callback function but got a [object Undefined]
at Route.(anonymous function) [as post] (/Users/Desktop/castApp/functions/node_modules/express/lib/router/route.js:202:15)
at Function.app.(anonymous function) [as post] (/Users/Desktop/castApp/functions/node_modules/express/lib/application.js:482:19)
at Object.<anonymous> (/Users/Desktop/castApp/functions/index.js:12:5)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
In my case, this error occurred when I deleted the function in the controller file but didn't update the corresponding place where needs this function as a callback function in the router file - index.js.
index.js:
app.post('/new', addNew);
const { addStandupHost } = require('./APIs/candidates');
candidate.js:
// exports.addNew = (request, response) => {
// ...
// db operation here
// ...
//}
It was solved just by deleting the corresponding code in index.js. To avoid this error, we should keep functions export and import consistent.

angular 2 async route module + entryComponents

I have an async loaded module with async route functionallity in angular 2. In the main module I have an implementation which uses the component factory to instantiate the component I added to the async module with entryComponents.
When I now try to instantiate it, I get the following error:
Error: No component factory found for InEntryComponentsComponent. Did you add it to #NgModule.entryComponents?
at NoComponentFactoryError.ZoneAwareError (http://localhost:3000/polyfills.dll.js:4731:33)
at NoComponentFactoryError.BaseError [as constructor] (http://localhost:3000/vendor.dll.js:28595:16)
at new NoComponentFactoryError (http://localhost:3000/vendor.dll.js:28716:16)
at _NullComponentFactoryResolver.resolveComponentFactory (http://localhost:3000/vendor.dll.js:28733:15)
at AppModuleInjector.CodegenComponentFactoryResolver.resolveComponentFactory (http://localhost:3000/vendor.dll.js:28777:35)
at SwapComponentDirective.set [as swapCmp] (http://localhost:3000/main.bundle.js:2959:66)
at Wrapper_SwapComponentDirective.check_swapCmp (/ModalModule/SwapComponentDirective/wrapper.ngfactory.js:50:26)
at View_ModalOverlay2.detectChangesInternal (/ModalModule/ModalOverlay/component.ngfactory.js:83:36)
at View_ModalOverlay2.AppView.detectChanges (http://localhost:3000/vendor.dll.js:79810:14)
at View_ModalOverlay2.DebugAppView.detectChanges (http://localhost:3000/vendor.dll.js:80005:44)
at ViewContainer.detectChangesInNestedViews (http://localhost:3000/vendor.dll.js:80143:37)
at CompiledTemplate.proxyViewClass.View_ModalOverlay_Host0.detectChangesInternal (/ModalModule/ModalOverlay/host.ngfactory.js:32:14)
at CompiledTemplate.proxyViewClass.AppView.detectChanges (http://localhost:3000/vendor.dll.js:79810:14)
at CompiledTemplate.proxyViewClass.DebugAppView.detectChanges (http://localhost:3000/vendor.dll.js:80005:44)
at ViewContainer.detectChangesInNestedViews (http://localhost:3000/vendor.dll.js:80143:37)
at CompiledTemplate.proxyViewClass.View_AppComponent_Host0.detectChangesInternal (/AppModule/AppComponent/host.ngfactory.js:31:14)
at CompiledTemplate.proxyViewClass.AppView.detectChanges (http://localhost:3000/vendor.dll.js:79810:14)
at CompiledTemplate.proxyViewClass.DebugAppView.detectChanges (http://localhost:3000/vendor.dll.js:80005:44)
at ViewRef_.detectChanges (http://localhost:3000/vendor.dll.js:59572:20)
at http://localhost:3000/vendor.dll.js:40308:67
at Array.forEach (native)
at ApplicationRef_.tick (http://localhost:3000/vendor.dll.js:40308:25)
at http://localhost:3000/vendor.dll.js:40227:105
at ZoneDelegate.invoke (http://localhost:3000/polyfills.dll.js:4162:26)
at Object.onInvoke (http://localhost:3000/vendor.dll.js:30260:37)
at ZoneDelegate.invoke (http://localhost:3000/polyfills.dll.js:4161:32)
at Zone.run (http://localhost:3000/polyfills.dll.js:4033:43)
at NgZone.run (http://localhost:3000/vendor.dll.js:30129:62)
at Object.next (http://localhost:3000/vendor.dll.js:40227:81)
at SafeSubscriber.schedulerFn [as _next] (http://localhost:3000/vendor.dll.js:42094:52)
at SafeSubscriber.__tryOrUnsub (http://localhost:3000/vendor.dll.js:591:16)
at SafeSubscriber.next (http://localhost:3000/vendor.dll.js:540:22)
at Subscriber._next (http://localhost:3000/vendor.dll.js:493:26)
at Subscriber.next (http://localhost:3000/vendor.dll.js:457:18)
at EventEmitter.Subject.next (http://localhost:3000/vendor.dll.js:4237:25)
at EventEmitter.emit (http://localhost:3000/vendor.dll.js:42080:76)
at NgZone.checkStable (http://localhost:3000/vendor.dll.js:30225:40)
at NgZone.onLeave (http://localhost:3000/vendor.dll.js:30301:14)
at Object.onInvokeTask (http://localhost:3000/vendor.dll.js:30254:27)
at ZoneDelegate.invokeTask (http://localhost:3000/polyfills.dll.js:4194:40)
at Zone.runTask (http://localhost:3000/polyfills.dll.js:4071:47)
at HTMLButtonElement.ZoneTask.invoke (http://localhost:3000/polyfills.dll.js:4265:33)
Anyone an idea how to get this running? When I move the component to a module which is not async loaded, then all is fine.
As a base I'm using the angular2-webpack-starter.

Error after updating meteor to 0.9.2

I get this error after updating meteor from 0.8 to 0.9.2
Uncaught TypeError: undefined is not a function dynamic_template.js:371
Uncaught TypeError: Cannot read property 'prototype' of undefined helpers.js:139
Uncaught TypeError: undefined is not a function router.js:61
Uncaught TypeError: Cannot read property 'RouteController' of undefined iron-router-progress.js?2b52a697e5a2fba4ec827721c08cfdd0a5bae508:25
Uncaught TypeError: Cannot read property 'RouteController' of undefined fast-render.js?b28103b086a46881dd8dde215dd8dfe85b2f693b:27
Uncaught Error: There are multiple templates named '__IronDefaultLayout__'. Each template needs a unique name. templating.js:9
Uncaught TypeError: undefined is not a function router.js:61
Uncaught TypeError: Cannot read property 'IronRouterProgress' of undefined global-imports.js?e50dcd2c89bf87a5ac45632b7280655943c6b817:6
Uncaught ReferenceError: Template is not defined template.admin_dashboard.js?00ebfb68d4f1c5e5ae7f687b10f53b2947bc5bb8:2

"node.js: throw e; // process.nextTick error," while trying browserid

I'm not going to use other module like request, how about writing this with http,
What should I consider while seeding post to browserid?
error:
$ coffee server.coffee
info - socket.io started
to send
to write
end?
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: getaddrinfo ENOENT
at errnoException (dns.js:31:11)
at Object.onanswer [as oncomplete] (dns.js:140:16)
source:
ll = console.log
fs = require 'fs'
page = fs.readFileSync 'page.html', 'utf-8'
query = require 'querystring'
client = fs.readFileSync 'client.coffee', 'utf-8'
page = page.replace '###', client
handler = (req, res) ->
res.writeHead 200, 'Content-Type': 'text/html'
res.end page
http = require 'http'
app = http.createServer handler
app.listen 8000
io = (require 'socket.io').listen app
io.set 'log level', 1
io.sockets.on 'connection', (socket) ->
socket.emit 'ready', 'go'
socket.on 'assertion', (data) ->
msg = query.stringify
assertion: data
audience: 'localhost:8000'
options =
host: 'https://browserid.org'
path: '/verify'
method: 'POST'
headers:
'Content-Type': 'application/x-www-form-urlencoded'
'Content-Length': msg.length
ll 'to send'
request = http.request options, (response) ->
str = ''
ll 'prepare'
response.on 'data', (chunk) ->
str += chunk
ll str
response.on 'end', ->
ll str
request.write msg
ll 'to write'
request.end()
ll 'end?'
with long-stack-traces:
$ coffee server.coffee
info - socket.io started
to send
to write
end?
Uncaught Error: getaddrinfo ENOENT
at errnoException (dns.js:31:11)
at Object.onanswer [as oncomplete] (dns.js:140:16)
----------------------------------------
at EventEmitter.on
at Array.<anonymous> (http.js:1147:12)
at EventEmitter._tickCallback (node.js:192:40)
----------------------------------------
at EventEmitter.nextTick
at ClientRequest.onSocket (http.js:1115:11)
at Agent.addRequest (http.js:938:9)
at new ClientRequest (http.js:1068:16)
at Object.request (http.js:1331:10)
at Socket.<anonymous> (/home/chen/code/home/git/docview/learning/coffee/browserid/server.coffee:52:22)
at Socket.$emit (events.js:67:17)
at SocketNamespace.handlePacket (/usr/lib/nodejs/socket.io/lib/namespace.js:335:22)
----------------------------------------
at EventEmitter.on
at SocketNamespace.<anonymous> (/home/chen/code/home/git/docview/learning/coffee/browserid/server.coffee:37:19)
at SocketNamespace.$emit (events.js:88:20)
at connect (/usr/lib/nodejs/socket.io/lib/namespace.js:292:10)
at /usr/lib/nodejs/socket.io/lib/namespace.js:308:13
at SocketNamespace.authorize (/usr/lib/nodejs/socket.io/lib/namespace.js:252:5)
at SocketNamespace.handlePacket (/usr/lib/nodejs/socket.io/lib/namespace.js:302:14)
at Manager.handleClient (/usr/lib/nodejs/socket.io/lib/manager.js:669:30)
----------------------------------------
at EventEmitter.on
at Object.<anonymous> (/home/chen/code/home/git/docview/learning/coffee/browserid/server.coffee:35:14)
at Object.<anonymous> (/home/chen/code/home/git/docview/learning/coffee/browserid/server.coffee:71:4)
at Module._compile (module.js:441:26)
at Object.run (/usr/lib/nodejs/coffee-script/lib/coffee-script/coffee-script.js:68:25)
at /usr/lib/nodejs/coffee-script/lib/coffee-script/command.js:135:29
at /usr/lib/nodejs/coffee-script/lib/coffee-script/command.js:110:18
at [object Object].<anonymous> (fs.js:115:5)
at [object Object].emit (events.js:64:17)
Uncaught undefined
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Looking at the http.request documentation, we find:
Options:
host: A domain name or IP address of the server to issue the request to. Defaults to 'localhost'.
hostname: To support url.parse() hostname is preferred over host
port: Port of remote server. Defaults to 80.
You might try these options instead:
options =
hostname: 'browserid.org'
port: 443
path: '/verify'
method: 'POST'
headers:
'Content-Type': 'application/x-www-form-urlencoded'
'Content-Length': msg.length
Edit: http.request doesn't work for SSL requests, for this, you need to use https.request. Changing to that fixes your other error as well, and the default port is 443 so you can omit that from the options if you wish.

Resources