Has anyone else started using Ionic Pro Monitoring yet? If you have, is it all working to your satisfaction? And if it is, are you using Lazy Loading? Reason for the question is that I’m having trouble with sourcemaps i.e linking errors to exact typescript line numbers. I’ve raised the issue with Ionic but wondered if anyone else has had success?
I’m having a similar issue. I’ve got it setup and reporting errors, but am not seeing TypeScript in the reports, just the transpiled JS code. I am using lazy loading. Are you? Are your reports at least showing TypeScript?
Yes, using Lazy Loading. They show Typescript but point to the wrong component - the sourcemaps all seem misaligned. Have you raised the issue with Ionic? I have an open issue with them.
Then you have gotten further than I have. I did open a support case with Ionic about a month ago. Following their advice, I updated the CLI and App-scripts. After that, still no luck. I will have to open a new support case with them.
Your problem is presenting as I would expect from a semver mismatch between what’s in IonicPro.init(…) and your config.xml, or the sourcemaps we’re ahead or behind what’s running on your channel at the time you sync’ed them.
Did you follow their code from the documentation to integrate it? Mine is a little different since I set it up before they had that in the docs. I was going to try making mine match next and seeing if that works.
Really interested in what they tell you to get it working. Such a bummer. I’ve wanted this for so long…
Another thing they told me that might help:
"…if you do a build, sync the sourcemaps, and then do a serve, you’ll be running a development version which might not match the sourcemaps you just synced."
Hmm. I did ask if Ionic serve would work ok and they said it would. But you may be right?
Hey all, looking into this this week, will respond here once we have more info. There currently is an issue with prod sourcemaps that we know about where line numbers don’t match up during sourcemapping. This is not an issue with Pro, but rather an issue for ionic framework/app scripts.
Will have more info on the Lazy loading issue this week.
Thanks.
I’ve narrowed down the issue. Hoping to have this fixed this week
Hi all, a few updates.
First of all, the lazy loading sourcemap issue should be resolved. We were incorrectly source mapping an exception from file, say, 12.js
with map main.js.map
, resulting in incorrect mappings. That has been resolved.
The prod sourcemap issue remains for now, however we confirmed with the Angular team that it was a bug in Angular, and they have identified a fix and we’re working with them on a resolution. SourceMaps have been a moving target in Angular and Ionic, unfortunately. That means no external error/monitoring service would be able to correctly map them while the issue remains.
Hoping to have that last one resolved in the coming week or so, fingers crossed.
Thanks Max. I won’t be able to try this until Thursday. Is there a new version of App Scripts for this or is this the build that runs when I do the Ionic Pro build?
No upgrades needed for the lazy load fix, that was all server side. The prod build one, when available, will probably require an upgrade for app scripts or angular itself.
Max, I know its probably very difficult to say right now but do you think the Prod fix will be coming in the next few weeks or is it a longer term thing?
Max, I just tried a new Monitoring test and it still did not work for me. My Steps:
- Increase the version number of my app.
- Ran the ionic monitoring syncmaps command (said Y to Build, N to Prod Build)
- Ran ionic serve
In the first line of my app.component constructor I have:
Pro.getApp().monitoring.exception(new Error('error'));
On the dashboard I get no mention of app.component.ts :
Exception Detail
Error: error
at new MyApp (main.js:5634:87)
at createClass (vendor.js:12526:20)
at createDirectiveInstance (vendor.js:12363:37)
at createViewNodes (vendor.js:13801:53)
at createRootView (vendor.js:13691:5)
at callWithDebugContext (vendor.js:15092:42)
at Object.debugCreateRootView [as createRootView] (vendor.js:14393:12)
at ComponentFactory_.create (vendor.js:11312:46)
at ComponentFactoryBoundToModule.create (vendor.js:4272:29)
at ViewContainerRef_.createComponent (vendor.js:11509:62)
Original Stacktrace
error
at new MyApp (main.js:5634:87)
at createClass (vendor.js:12526:20)
at createDirectiveInstance (vendor.js:12363:37)
at createViewNodes (vendor.js:13801:53)
at createRootView (vendor.js:13691:5)
at callWithDebugContext (vendor.js:15092:42)
at Object.debugCreateRootView [as createRootView] (vendor.js:14393:12)
at ComponentFactory_.create (vendor.js:11312:46)
at ComponentFactoryBoundToModule.create (vendor.js:4272:29)
at ViewContainerRef_.createComponent (vendor.js:11509:62)
Am I doing anything wrong?
I haven’t. I was planning on trying after the app-scripts update came out. However, we are doing a new beta release tomorrow, so I’ll sync the sourcemaps too. If it works, I’ll let you know.
I tried again today and its still not working for me (with a dev build)
We did a deploy Friday and I didn’t realize they updated app-scripts to 3.1.5 until afterward. Regardless, I did the update, did a full prod build and synced the source maps.
Since then, I’ve only had 2 errors reported, and I’m not 100% positive that they occurred before I upgraded and synced. However, they are still not what I expect. They are pretty ugly:
if ((‘click’ === en)) {
const pd_0:any = ((_co.open(‘MePage’)) !== false);
ad = (pd_0 && ad);
}
return ad;
},i15.View_Button_0,i15.RenderType_Button)),i0.ɵdid(24,1097728,(null as any),
0,i16.Button,[[8,’’],i3.Config,i0.ElementRef,i0.Renderer],{color:[0,‘color’],
large:[1,‘large’],clear:[2,‘clear’]},(null as any)),(_l()(),i0.ɵted(-1,
at Object.handleEvent (pages/maps/maps.ngfactory.ts:208:75)
If more errors are reported, and they look good, I’ll let you know.
At least I’m starting to see TypeScript though! But, it’s clearly not what I wrote.
Prod builds won’t work yet - that’s a known issue with Angular. But @max implied Dev builds should work. But not for me, unless I’m doing something wrong.
I see. Thanks for the clarification.