Expand my Community achievements bar.

SOLVED

URGENT Debugging an archived library in production

Avatar

Level 2

I have an archived library, let's call it "library A" that i need to debug. I published it (library A) to production, the change that was in there was failing. I had to revert to the previous library, let's call that "library Z". I need to use the library, library A, in the production environment, but without republishing it. I need the _satellite.environment.staging value to equal "production" during my debugging. This is the reason I can't use a development or staging version of library with the same change. I found an article that said I could download it, but there's no "Download" option in the dropdown (see screenshot attached). If I could get that, then I could use devtools to replace the published file, locally, and debug. 

 

How can I download the archived library, library A?

 

1 Accepted Solution

Avatar

Correct answer by
Level 2

I found a way shortly after posting this. I made a new library with the same change that i needed from the archived library (Library A). I opened the unminified js file (by removing .min from the js file url) and changed the stage value from "development" to "production". I was able to use that successfully in chrome devtools' local override. It's a little hacky, but it works for debugging. Hopefully someone else finds this helpful.

View solution in original post

3 Replies

Avatar

Correct answer by
Level 2

I found a way shortly after posting this. I made a new library with the same change that i needed from the archived library (Library A). I opened the unminified js file (by removing .min from the js file url) and changed the stage value from "development" to "production". I was able to use that successfully in chrome devtools' local override. It's a little hacky, but it works for debugging. Hopefully someone else finds this helpful.

Avatar

Community Advisor

There are 3 other ways that you can load another Launch snippet into a website:

  1. Use the AEP Debugger browser extension. In the Launch section, you can specify the <script> snippet that it will load to override the one that is loaded by the website. However, from my personal experience, I've found that this method only works sometimes.
  2. Use the Launch Switch browser extension. This extension allows you to switch between different environments (development, staging, production) for the Launch property that your website loads. It's a bit tricky to setup this extension, but when you get it to work, then it works really well.
  3. If you're comfortable with writing code, use Google Chrome's Overrides feature to rewrite the Launch <script> in your website to load the one that you want. Learn more about the Overrides feature: https://developer.chrome.com/docs/devtools/overrides/

There are other browser extensions that allow you to override your website's code within your browser, but I normally rely on the 3 methods above.

Avatar

Level 2

#3 is what I ended up doing.

The Debugger works for using different libraries, but it retains the environment which that library is in. For example, if you use a staging library in the debugger, on your production url, the environment will stay as staging. So any rules that fire based on a condition of "is environment production equal to true" will not fire. This is the scenario I was facing. #3 was the only way to work in this case. 

Thank you for providing the other two options though.