webcompat / web-bugs

A place to report bugs on websites.
https://webcompat.com
Mozilla Public License 2.0
746 stars 67 forks source link

Intranet site that uses `liferay-amd-loader` - site is not usable #134899

Open Anutrix opened 7 months ago

Anutrix commented 7 months ago

URL: Intranet site Browser / Version: Firefox 124.0 Operating System: Mac OS X 10.15 Tested Another Browser: Yes. Works fine on Safari.

Problem type: Site is not usable Description: Page not loading correctly Steps to Reproduce: Page is broken on Firefox due to Error.captureStackTrace not being available on Firefox but present on Chrome AND Safari. Failure is in liferay-amd-loader.

Browser Configuration
  • None

From webcompat.com with ❤️

Anutrix commented 7 months ago

Closing as intranet sites are supported here it seems.

sv-calin commented 7 months ago

Thanks for the report. Did you mean that "are not supported"? It's not that the intranet are not supported but we are unable to test and debug on our own, to check what's the exact problem.

Suggestions: • Clear cache/data/cookies, disable Ad-blocker (if available), or use a clean profile and check again • If there are any changes made to the default settings of the browser (e.g. in about:config), please revert to the default settings

How to create a new profile:

  1. Open a new tab and type in the address bar "about:profiles".
  2. Click "Create a New Profile".
  3. Click "Continue", name your profile and then Click "Done".
  4. Head to your newly created profile and click "Launch profile in new browser".

Note: You can return to your old profile at any given time by accessing "about:profiles" in the address bar

[qa_12/2024]

Anutrix commented 7 months ago

It's not that the intranet are not supported but we are unable to test and debug on our own, to check what's the exact problem.

I just mean intranet is not publicly accessible.

Issue persists and Error.captureStackTrace error is seen in console.

sv-calin commented 7 months ago

Please take a screenshot with the console errors Firefox vs Chrome. Also please try on Firefox Nightly as well and give us an update.

[inv_12/2024]

Anutrix commented 7 months ago

OS: MacOS Sonoma 14.4 (Intel)

Firefox 124.0 (64-bit): Page is broken.

Screenshot 2024-03-20 at 18 42 52

Had to darken out of sensitive details where I can. Sry. Above these 2 error logs, there is only info logs which are same what we see in Chrome below.

Safari: Page works fine.

Screenshot 2024-03-20 at 19 00 20

Chrome: Page works fine.

Screenshot 2024-03-20 at 19 09 42
sv-calin commented 7 months ago

@Anutrix Thanks for the screenshots, have you tried on Firefox Nightly (on a new profile) as well?

@denschub could take a look at the console errors, please?

[inv_12/2024]

denschub commented 7 months ago

Error.captureStackTrace is a completely unspecified feature invented by V8. Safari seems to have implemented it recently, but without announcement, so the fact that this works is a mere accident.

Failure is in liferay-amd-loader.

Neither the archived liferay/liferay-amd-loader repo, nor the component source inside the liferay/liferay-frontend-projects repo have any call to Error.captureStackTrace

@Anutrix can you double-check where that call is made? If it's inside your application logic, there's little we can do and you need to gate that call behind feature detection - but if it's in an upstream library, we'd like to know.

softvision-raul-bucata commented 7 months ago

ping @Anutrix

[inv_13/2024]

Anutrix commented 7 months ago

Error.captureStackTrace is a completely unspecified feature invented by V8. Safari seems to have implemented it recently, but without announcement, so the fact that this works is a mere accident.

Failure is in liferay-amd-loader.

Neither the archived liferay/liferay-amd-loader repo, nor the component source inside the liferay/liferay-frontend-projects repo have any call to Error.captureStackTrace

@Anutrix can you double-check where that call is made? If it's inside your application logic, there's little we can do and you need to gate that call behind feature detection - but if it's in an upstream library, we'd like to know.

It seems like it's inside the application logic but still related to liferay's frontend-js-loader-modules-extender based on the unredacted part of log:

Stack trace of the require() calls:
    value@intranet-url/../frontend-js-loader-modules-extender/loader.js?<some-device-params>:2:12345
    @<intranet-full-page-url>:2345:16

TypeError: Error.captureStackTrace is not a function

Regardless, site breaks due to Error.captureStackTrace. If WebKit has implemented, maybe Firefox can also looking into it.

Also, on the different note, like you said captureStackTrace is rare(https://github.com/search?q=org%3Aliferay+captureStackTrace&type=code) and I just found few asserts: https://github.com/liferay/liferay-apps-content-targeting/blob/235c12023d112ce89f8b336c9ee5ffe48f5ab327/analytics-hook/docroot/META-INF/custom_jsps/html/js/analytics/analytics.js

denschub commented 7 months ago

It seems like it's inside the application logic but still related to liferay's frontend-js-loader-modules-extender based on the unredacted part of log

There is no call to captureStackTrace anywhere in that project.

Also, on the different note, like you said captureStackTrace is rare(https://github.com/search?q=org%3Aliferay+captureStackTrace&type=code) and I just found few asserts: https://github.com/liferay/liferay-apps-content-targeting/blob/235c12023d112ce89f8b336c9ee5ffe48f5ab327/analytics-hook/docroot/META-INF/custom_jsps/html/js/analytics/analytics.js

That file has one call to the function. And it's inside a function called stack, which only gets called after a feature detection, so this can't be the cause of your breakage. :(

Regardless, site breaks due to Error.captureStackTrace. If WebKit has implemented, maybe Firefox can also looking into it.

We are looking into it. The problem here is that there are thousands of things we have to look into, implement, and ship - so we have to prioritize things somehow. And that's the motivation for asking these questions: if the cause of breakage is in your application logic, then it's affecting a single site and the issue will have a low priority. However, if the breakage is caused by a popular library, the issue would have a much higher priority, and we can justify accelerating the investigations and implementation.

We usually look at the offending code ourselves and figure that out, but since this is an application we don't have access to, it's impossible for us to do that work, and so it's impossible for me to justify a high priority.

Please have whoever team is building that application look into this issue, and report back. If they need help figuring it out, or if they have additional questions or concerns, feel free to tell them my email address, dschubert@mozilla.com, and we're happy to help out.

Anutrix commented 7 months ago

Unfortunately, the page/application support(devs aren't accessible) just advised me to use Chrome and Safari.

But I think I found the issue. I tried putting a break point at the Error.captureStackTrace and followed the call-stack.

First of all, the error is ERR_FR_TOO_MANY_REDIRECTS. Not sure if this is Firefox specific. A catch block containing Error.captureStackTrace tries to run. It also led me to ./node_modules/follow-redirects/index.js and then node_modules/axios/dist/node/axios.cjs above it.

Turns out there already exist tickets forError.captureStackTrace: https://github.com/follow-redirects/follow-redirects/issues/237 https://github.com/axios/axios/issues/6182

Note that the scripts were minified so I couldn't get more info.

Update: I tried stopping the breakpoint and ran Error.captureStackTrace = ()=>{return null}; in the console. The page/application worked perfectly when I continued. Similar behavior to how it works on almost every other browser(Chromium-based and WebKit-based). Maybe Firefox can implement a dummy function with a warning like this.