NebulaLogger icon indicating copy to clipboard operation
NebulaLogger copied to clipboard

LWC Component Name doesn't populate when creating a log from LWC

Open EllieAtWHL opened this issue 1 year ago • 2 comments

Package Edition of Nebula Logger

Unlocked Package

Package Version of Nebula Logger

4.7.8

New Bug Summary

Creating a log from an LWC using the following code:

const logger = this.template.querySelector('c-logger');
logger.error(errorMessage)
logger.saveLog();

Creates a Log and Log Entry record, but although the Log Entry recognises the Component Type as an LWC, the Component Name doesn't get populated.

Screenshot 2022-08-04 at 22 07 51

EllieAtWHL avatar Aug 04 '22 21:08 EllieAtWHL

@EllieAtWHL thanks so much for reporting this! It looks like Salesforce might have recently changed some of the JavaScript stack traces for LWC, which has broken the parsing of the component name & function. I'll try to get this resolved ASAP!

jongpie avatar Aug 08 '22 15:08 jongpie

@EllieAtWHL I was able to get this fixed last night, it'll be included in the next release v4.8.0 - I'm hoping it have it released in the next few days.

jongpie avatar Aug 10 '22 16:08 jongpie

I am seeing this issue with v4.11 :-(

skostojohn avatar Aug 16 '23 22:08 skostojohn

Facing Same issue with v4.11.12

monika-gupta-erudite avatar Nov 07 '23 10:11 monika-gupta-erudite

@skostojohn and @monika-gupta-erudite could you both check to see if you have Lighting Web Security (LWS) enabled in your orgs? I think some recent changes in LWS (and possibly the older Locker Service) have broken stack traces again, which are used to determine the component name.

You can check in your org, under Setup --> Session Settings, to see if LWS has been enabled in your orgs.

image

I'm also reopening this issue, since it seems to be a widespread problem.

jongpie avatar Nov 07 '23 19:11 jongpie

@jongpie Thanks for a quick reply. I enabled LWS in my org based on your suggestion but still facing same issue.

monika-gupta-erudite avatar Nov 08 '23 03:11 monika-gupta-erudite

@skostojohn and @monika-gupta-erudite I've released another fix for this issue in v4.12.7. I'm hoping this solves the issue, but please let me know if you run into any more issues with it.

jongpie avatar Jan 28 '24 20:01 jongpie