jomarko commented on issue #337:
URL: 
https://github.com/apache/incubator-kie-issues/issues/337#issuecomment-1917124014

   Hi @tiagobento @yesamer , I was interested, if this issue is still 
reproducible and did some manual tests. Here are my findings.
   
   # Issue Still Exists
   Once user tries to open **sandbox.kie.org** in **Firefox**, there is still 
the same error in the logs:
   ```
   Uncaught (in promise) TypeError: env is undefined
   ```
   
   It is a very strange, because it is related to code of the function 
component `IncompatibleBrowser.Component`:
   ```
   const { env } = useEnv();
   ```
   
   And similar short snippet is used in our codebase many times, for example in 
the `AboutButton` and that button works properly once I run **sandbox** on the 
**Firefox** see next section.
   
   # Firefox seems compatible
   Currently for **online-editor** we do not list **Firefox** as compatible 
browser. However comparing:
   - **online-editor** compatibility 
[mechanism](https://github.com/apache/incubator-kie-tools/blob/main/packages/online-editor/src/workspace/startupBlockers/IncompatibleBrowser.tsx)
 
   - with **serverless** compatibility [mechanism 
](https://github.com/apache/incubator-kie-tools/blob/main/packages/serverless-logic-web-tools/src/workspace/startupBlockers/SupportedBrowsers.ts)
   
   
   I decided to try **Firefox**
   
   So changed **online-editor** `isCompatibleBrowser` constant to:
   ```
   const isCompatibleBrowser = 
Bowser.getParser(window.navigator.userAgent).satisfies({
     chrome: ">4",
     edge: ">=79",
     firefox: ">=38",
     safari: ">=16",
     mobile: {
       safari: ">=16",
     },
   });
   ```
   
   Then everything seems to be working:
   - creating assets
   -  importing assets/folders
   - integrating sandbox with github account
   - DMN Runner and Extended Services
   
   ![Screenshot 2024-01-30 
130721](https://github.com/apache/incubator-kie-issues/assets/8044780/3c990c92-23ad-414c-9431-a3c443678e98)
   
   
   # Solution
   I tend to think we could mark **Firefox** as compatible for 
**online-editor** because after my manual test it seems to me as working. Or is 
there some reason to keep it incompatible? Maybe there is reason, I came to the 
project later, so asking, if there is reason, I am fine to keep it uncompatible.
   
   However that still doesn't answer, why the `useEnv()` snippet causes error. 
I am not sure how to start "searching solution" for this effectively. General 
React documentation for custom hooks doesn't touch similar specic situations.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to