“No map found” error when running NativeScript Angular 2 app - nativescript

I’ve got a really weird error when trying to run an app built with NativeScript and Angular 2. Here’s the error:
CONSOLE ERROR file:///app/tns_modules/nativescript-angular/zone.js/dist/zone-nativescript.js:342:26:
Unhandled Promise rejection: No map found ; Zone: angular ; Task: Promise.then ; Value: No map found undefined
CONSOLE ERROR file:///app/tns_modules/nativescript-angular/zone.js/dist/zone-nativescript.js:344:22:
Error: Uncaught (in promise): No map found
The error occurs when the app starts up. I’m using nativescript-angular version 1.1.2 and I’m including zone.js version 0.6.21 in my devDependencies. Here’s my full package.json: https://github.com/tjvantoll/nativescript-photos-near-me/blob/6a201b05e91687618670a79e0a56ababc71572d7/package.json.
Any idea what might be up? I’m not actually using zones explicitly in my app, so I’m very curious why I’m getting this app here but not in new NativeScript Angular apps I start from scratch.
Any help would be appreciated.

So as soon as I posted this I figured this out. The problem was an innocuous looking call to the Mapbox plugin’s unhide() method.
I assumed “map” was referring to some RxJS or Array value, when it was actually referring to an actual map. Who knew?

Related

Getting Hydration Failed errors in shopify when building the first app

I am learning how to code an Shopify app. I wanted to build first app and I started following this tutorial : https://shopify.dev/apps/getting-started/create
I used npm init #Shopify/app#latest to create first app, then moved to that directory using cd .\first-app\ then I used npm run dev App looks and works fine with UI but on console I am getting lots of errors. Here are few of them.
Hydration failed because the initial UI does not match what was rendered on the server.
There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.
vendors-node_modules_bugsnag_js_browser_notifier_js-node_modules_shopify_monorail_lib_monorai-fdaebc-b7c7bc61031d801d7cdf29f30133708999e0fe454a161247422ecc3e28c64ef8.js:2
Uncaught (in promise) Error: Error completing request. A network failure may have prevented the request from completing. Error: TypeError: Failed to fetch
And few more, I did set up the ngrok tunnel and it is working fine.
I might be missing something, any help or pointing me to right direction is appriciated
Trying to build my first app on Shopify going through their documentation using : https://shopify.dev/apps/getting-started/create

Quickblox.sdk GetBaseSession() method throws "nonce is required" error

I have used quickblox chat sdk in my old xamarin.forms project. I know that quickblox is not supporting xamarin now, but old sdk was working fine till now, but from last week I am getting this error.
Code:
var baseSesionResult = await Provider.QbProvider.GetBaseSession();
When I am calling QbProvider.GetBaseSession() it throws below error:
CONTENT: {"errors":{"base":["nonce is required"]}}
I have tried different methods available in sdk but none is working. Any one know how to fix this error?
This is Nikolay from QuickBlox support.
Please add "" symbols around nonce and timestamp values and check if the issue is resolved.
The same information is mentioned in our documentation: https://docs.quickblox.com/reference/authentication#create-session
We released a patch for authentication that improves validation according to our documentation.
Hence, the issue is caused by incorrect implementation in the application that is why the server has started showing errors for submitted requests.

tns preview doesn't work doe to unexpected token

Project successfully prepared (ios)
Start sending initial files for device iPhone.
Successfully sent initial files for device iPhone.
SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse ()
at PreviewSdkService. (/usr/local/lib/node_modules/nativescript/lib/services/livesync/playground/preview-sdk-service.js:100:43)
at Generator.next ()
at fulfilled (/usr/local/lib/node_modules/nativescript/lib/services/livesync/playground/preview-sdk-service.js:4:58)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
hey i have exact the same error on same position in preview-sdk-service.js i reinstalled everything with no errors but still the same. i contacted the support, when i get an answer i will let you know. i have also problems with playground today it will not load correctly on my device. btw yesterday it worked like a charm.
---------SUPPORT ANSWER--------------
"we are migrating the auth to use Firebase and looks like couple things are still propagating. An engineer is working on this and should be resolved by Monday"
so its not a user mistake and we can just wait and hope they can fix it quickly.
I'm running into this exact issue at the moment. Even started a new template using the Angular CLI command:
ng new --collection=#nativescript/schematics my-mobile-app
From the site:
Angular CLI support
The initial template seem to work but after adding some custom modules this started happening. Running on a Android Virtual Device works.
I've been looking for a solution and the issues seems to ga back as far as 2018 so i'm not sure if this is even een NativeScript issues of a dev environment issues not being setup correctly.

Accessing Android activity object during app startup - Nativescript

Before I upgraded to NS 3.4, I used to call the following function in the app start-page's navigatingTo method
application.android.foregroundActivity.getResources()
But looks like now in 3.4 - foregroundActivity is undefined - at least while the app is starting up.
Is there an alternate solution?
We can use
application.android.startActivity
However, there was a discussion about the changes in foregroundActivity and startActivity and the updated information about how those will react in the upcoming NativeScript can be found in this thread

Nativescript error context is not fully stringified

It makes development really hard when you can't see stacktrace and the context of the error. Is there any way to make nativescript errors more transparent? How I can manage to stringify the error context?
JS: ERROR TypeError: format.replace is not a function
JS: ERROR CONTEXT [object Object]
It is really hard to search for that null variable. A needle in the haystack...
I found a workaround solution but still we should spend time to view the error context.
If you are using Angular with Nativescript probably your error is being thrown from core.umd.js (#Angular). Without Nativescript every field of the error is visible. I found two solutions that still take time:
Method 1: You can easily debug your error by placing a breakpoint to callWithDebugContext function.
Method 2: You can catch any throw on any level using try...catch, you may wrap your method and stringify your err.context.
I am not considering top most level try...catch as a solution.
But these are still not the best way. Nativescript team should fix this console logging issue.

Resources