1246
Views
8
Comments
Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element
Question

Hello Everyone,

On my mobile app i am getting an Error on every page which says "Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'." , Can anyone help me out what is this error and how can i get rid of it.


Thanks ,

Nitesh
 

2020-09-11 18-53-44
Stacey Levine

Hi Nitesh,


What you have provided is not enough information to even begin to help you.  At the very least, you should include your platform version, service studio version, and the full error message from the error log.  Ideally, you would share a sample application (or the real one) where the error can be recreated.


Stacey

UserImage.jpg
Kingsley Okpara

I am having the same issue, my code is right below, everything looks good, but I can't proceed more than this, its on javascript


<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />

    <title>Mini App</title>

    <style>
     
      body {
        background: lavender;
        margin: 0;
        height: 100%;
        overflow: hidden;
      }
     
      h2 {
        margin-bottom: 2em;
        text-align: center;
      }  
               
      div.user-photo {
        width: 150px;
        height: 150px;
        margin: 1em auto;
        position: auto;
        background: #fff;
        border-radius:100px;
      }
     
      div.details {
        background-color: #6200ee;
        font-size: 2.3em;
        margin: 2.5em 0.2em 0.2em 0.2em;
        color: #fff;
        padding: 1.1em;
        min-height: 6em;
      }
      img {
        width: 150px;
        height: 150px;
        border-radius: 100px;
        display: inline=block;
      }
     
      footer {
        width: calc(100% - 2em);
        z-index: 500;
        position: absolute;
        bottom: 0;
        overflow: hidden;
        display: flex;
        justify-content: space-between;
        margin: 0 1em;  
      }
     
      footer button.mdc-icon-button {
        margin: 0.5em;
      }
     
    </style>
  </head>
  <body>
   
    <h2>kingsley Okpara</h2>
   
    <div class="user-photo mdc-elevation--z3">
      <a href="https://placeholder.com"><img src="https://via.placeholder.com/150"></a>
    </div>
   
    <div class="details mdc-elevation--z3"></div>
   
    <div class="messages"></div>

   
    <footer>
      <button id="btn-Address" class="mdc-icon-button material-icons" style="color:#ffffff;">Address</button>
   <button id="btn-Phone" class="mdc-icon-button material-icons" style="color:#ffffff;">Phone</button>
     <button id="btn-Birthday" class="mdc-icon-button material-icons" style="color:#ffffff;">Birthday</button>
    </footer>
    <script>
 
      const style = window.getComputedStyle(backgroud-color, null);
     
      const notify = (msg) => {
        const toastr = document.querySelector('.messages');
        if(!toastr) return;
       
        toastr.textContent = msg;
        if(!toastr.classList.contains('on')) {
          toastr.classList.add('on');
        }
      };
     
      const clearNotice = () => {
        const toastr = document.querySelector('.messages');
        if(!toastr) return;
       
        toastr.textContent = '';
        toastr.classList.remove('on');
      };
     
      const displayUserPhotoAndName = (data) => {
        if(!data) return;
       
        // add your code here

        clearNotice();
      };
           
      const getAUserProfile = () => {
        const api = 'https://randomuser.me/api/';
       
        // make API call here
       
        notify(`requesting profile data ...`);
      };
     
      const startApp = () => {
        // invoke the getAUserProfile here
      };
     
      startApp();
    </script>
  </body>
</html>


2022-04-29 11-28-26
Nitesh Ahirwar

Hi Stacey ,

This is what i am getting :

Message:Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
Environment InformationeSpaceVer: 2579 (Id=10855, PubId=10808, CompiledWith=10.0.828.0)
RequestUrl: https://landuscooperative-dev.outsystemsenterprise.com/LandusMobile/moduleservices/log?clientTimeInMillis=1552343373974 (Method: POST)
AppDomain: /LM/W3SVC/1/ROOT/LandusMobile-765-131967901520034718
FilePath: d:\OutSystems\Platform Server\running\LandusMobile.01141413462\
ClientIp: 174.217.7.60
DeviceUUID: f9badfa0febe0edb
Locale: en-US
DateFormat: yyyy-MM-dd
PID: 2532 ('w3wp', Started='2/20/2019 1:20:18 AM', Priv=959Mb, Virt=9850Mb)
TID: 210
Thread Name:
.NET: 4.0.30319.42000
Client-Side Log
Stack:TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
    at t.getAnimationClassName (https://landuscooperative-dev.outsystemsenterprise.com/LandusMobile/scripts/OutSystemsReactView.js?0RZ4v0ybiPcLJg7mVX1Bxw:6:3817)
    at t.transition (https://landuscooperative-dev.outsystemsenterprise.com/LandusMobile/scripts/OutSystemsReactView.js?0RZ4v0ybiPcLJg7mVX1Bxw:6:1422)
    at t.componentWillAppear (https://landuscooperative-dev.outsystemsenterprise.com/LandusMobile/scripts/OutSystemsReactView.js?0RZ4v0ybiPcLJg7mVX1Bxw:6:1779)
    at t.performAppear (https://landuscooperative-dev.outsystemsenterprise.com/LandusMobile/scripts/OutSystemsReactView.js?0RZ4v0ybiPcLJg7mVX1Bxw:4:13930)
    at t.componentDidMount (https://landuscooperative-dev.outsystemsenterprise.com/LandusMobile/scripts/OutSystemsReactView.js?0RZ4v0ybiPcLJg7mVX1Bxw:4:13250)
    at t.o (https://landuscooperative-dev.outsystemsenterprise.com/LandusMobile/scripts/OutSystemsReactView.js?0RZ4v0ybiPcLJg7mVX1Bxw:8:26609)
    at t.e.(anonymous function) [as componentDidMount] (https://landuscooperative-dev.outsystemsenterprise.com/LandusMobile/scripts/OutSystems.js?oPGXQmcWYrdRVt9OsgLnOQ:8:27296)
    at r.notifyAll (https://landuscooperative-dev.outsystemsenterprise.com/LandusMobile/scripts/OutSystemsReactView.js?0RZ4v0ybiPcLJg7mVX1Bxw:1:6756)
    at r.close (https://landuscooperative-dev.outsystemsenterprise.com/LandusMobile/scripts/OutSystemsReactView.js?0RZ4v0ybiPcLJg7mVX1Bxw:4:8393)
    at r.closeAll (https://landuscooperative-dev.outsystemsenterprise.com/LandusMobile/scripts/OutSystemsReactView.js?0RZ4v0ybiPcLJg7mVX1Bxw:5:10699)


Platform Version: 10.0.828.0

Development Environment Version:10.0.902.0

Screenshot attached.

Hope this helps ..!


Thanks ,

Nitesh





ErrorLandusMobile.jpg
2019-01-23 10-11-10
Carlos Almeida

Hello,


Any news on this error? Started happening to us today. (switched the app and server name with * for client anonimity)


 InformationeSpaceVer: Id=14370, PubId=0, CompiledWith=11.0.614.0
ClientIp: 89.115.130.81
DeviceUUID: 8f8f58fcfdd9c01f
Locale: en-US
DateFormat: dd-MM-yyyy
PID: 3288 ('w3wp', Started='1/23/2020 12:12:58 AM', Priv=1479Mb, Virt=2108609Mb)
TID: 46
Thread Name:
.NET: 4.0.30319.42000
DeviceModel: SM-A505FN
DeviceUUID: 8f8f58fcfdd9c01f
OperatingSystem: Android 9
NativeShell: 8.0.1
AppVersionCode: 32
AppVersionName: 0.24
NetworkStatus: Online
NetworkType: WIFI
Cordova: 8.1.0
Client-Side Log
Stack:TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
    at t.getAnimationClassName (https://*/scripts/OutSystemsReactView.js?MIv2P848ETrJCar8mghbTw:6:2462)
    at t.transition (https://*/scripts/OutSystemsReactView.js?MIv2P848ETrJCar8mghbTw:6:35)
    at t.componentWillEnter (https://*/scripts/OutSystemsReactView.js?MIv2P848ETrJCar8mghbTw:6:609)
    at t.performEnter (https://*/scripts/OutSystemsReactView.js?MIv2P848ETrJCar8mghbTw:4:13240)
    at Array.forEach (<anonymous>)
    at t.componentDidUpdate (https://*/scripts/OutSystemsReactView.js?MIv2P848ETrJCar8mghbTw:4:12608)
    at t.o (https://*/scripts/OutSystemsReactView.js?MIv2P848ETrJCar8mghbTw:8:23562)
    at t.e.<computed> [as componentDidUpdate] (https://*/scripts/OutSystems.js?HvtKqoY2S3d44mUghdrcFg:9:20160)
    at r.notifyAll (https://*/scripts/OutSystemsReactView.js?MIv2P848ETrJCar8mghbTw:1:6738)
    at r.close (https://*/scripts/OutSystemsReactView.js?MIv2P848ETrJCar8mghbTw:4:7293)
2018-05-11 10-51-15
Tiago Reis

Hello.


Any news on this topic?


Thanks

2022-10-07 14-10-51
NNG

Hello Team,

Any solution on above error ???

bcz today  I'm getting same error .

Thanks


Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'. TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'

2025-06-09 17-04-50
Musa Rikhotso

Hi everyone. I was getting the same error on one of my popup screens, I just rebuilt the same popup screen and it's working fine. 

I only rebuilt it because it wasn't a lot of work and I was trying to recreate the error, but it just worked the second time around. Hope this will help someone

Best regards!

2014-02-27 15-13-14
Nuno Morgado

I got the same error. In my case was because a list had the "Animate Items" set as "Yes". Once i changed to "No" i no longer have the error. Hope it helps

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.