TypeError: Cannot read properties of null (reading 'cssRules') #1212
Replies: 15 comments 39 replies
-
@itsjwala this fixed the cssRules error but i still cant use the latest version it gives some unknown errors now not showing up in the log https://github.com/infor-design/enterprise-wc/actions/runs/4365577412/jobs/7637547882#step:10:29623 Just mentioning it in case you have an idea. If not i can try to get verbose logs turned on (is that possible I forget) when i have more time and make a new issue. |
Beta Was this translation helpful? Give feedback.
-
@tmcconechy I see the visual changes are happening due to javascript being enabled. Is there any reason for enabling it? (If its Shadow DOM, then we support it since 1.19.2+) We noticed that the visual errors are a result of javascript side effects. Can you try disabling it and running the builds? |
Beta Was this translation helpful? Give feedback.
-
@samarsault i disabled it on https://github.com/infor-design/enterprise-wc/pull/1165 but it a) still has a lot of errors b) the images dont look correct anymore. We do use shadowRoot (web components). But not sure i recall why we enabled it. I think support suggested it. Still this only is a problem moving up from 1.18.0 https://github.com/infor-design/enterprise-wc/actions/runs/4375912710 |
Beta Was this translation helpful? Give feedback.
-
@tmcconechy we see some unusual diffs in your build and will take a look. Can you try using the latest version setting |
Beta Was this translation helpful? Give feedback.
-
@samarsault still doing some weird things https://github.com/infor-design/enterprise-wc/actions/runs/4397781859/jobs/7716169624 https://github.com/infor-design/enterprise-wc/pull/1165 I would think we want JS and shadowRoot since these are JS components and they use web components/shadowRoot |
Beta Was this translation helpful? Give feedback.
-
@samarsault should i be using the support at browser stack instead? My concern is we can no longer update and use percy so might need to look at other options before renewing. |
Beta Was this translation helpful? Give feedback.
-
@tmcconechy For the enableJavascript: false case, I see the following classes of visual changes in your build
Also, is the cypress test failure happening because of percy? If yes, what is the error message? Edit: |
Beta Was this translation helpful? Give feedback.
-
ok thanks @samarsault cant seem to get it to work with any configuration i can come up with. We use JS and and its all web components so Js off is not an option (will show nothing). Shadow root is also needed, without it will show nothing on the page. This is the last build https://github.com/infor-design/enterprise-wc/pull/1165 every time it just comes up with errors on each test i cant figure out. So will log a support ticket for now. Cheers |
Beta Was this translation helpful? Give feedback.
-
@tmcconechy I have discussed this with my team and we're checking this issue on priority. |
Beta Was this translation helpful? Give feedback.
-
@samarsault you could run it one of two ways
or just like this all the tests for percy are labeled with percy in the name
We dont use cypress at the moment its jest/jest puppetteer. I've never seen that error before. Did you do |
Beta Was this translation helpful? Give feedback.
-
Hmm when i try those it works ok. Im not 100% sure. Maybe try Failing that maybe if you want i can test the fix? Or you could try to test it by modifying the PR? |
Beta Was this translation helpful? Give feedback.
-
@itsjwala - I cant seem to find a way to make this work with some of our components. Take for example But your code is serializing this in a weird way that causes the row children to be added before the parent. Is there any way to do the old way? According to https://github.com/percy/cli/pull/1165/files#diff-02067f8a8ffa312638a2a6525baaabf925e44fc81392b24fc9de58604100be75R27 disableShadowDom might work (didnt in my tests). But this is going away? Other thing that is weird is a lot of text elements are duplicated in the snap shots (see some text duplicated/icons duplicated ect)... Maybe we can have some options for serializing here? The old way did work pretty good for us |
Beta Was this translation helpful? Give feedback.
-
@tmcconechy Thanks for your patience. We've been looking into your issues and here's what we got:
snapshot:
percyCSS: |
iframe#webpack-dev-server-client-overlay {
display: none
}
|
Beta Was this translation helpful? Give feedback.
-
FYI after our call i let our ci run it and it did run into errors https://github.com/infor-design/enterprise-wc/actions/runs/5015136541/jobs/8990283101 I think when i ran it local it wasnt pointing to percy and just skipping tests, so I will have to look at this some more. |
Beta Was this translation helpful? Give feedback.
-
@tmcconechy Can you refactor all your calls to You can try something like: function customPercySnapshot(page, name, options) {
return percySnapshot(page, name, { disableShadowDOM: true, ...options })
}
export default customPercySnapshot And then import this as |
Beta Was this translation helpful? Give feedback.
-
The problem
Upgraded from 1.18.0 to 1.20.1 and now get this error on most tests:
Environment
@percy/cli
version: 1.20.1Details
Example test https://github.com/infor-design/enterprise-wc/blob/main/test/ids-data-grid/ids-data-grid-percy-test.ts
Debug logs
https://github.com/infor-design/enterprise-wc/actions/runs/4315837554/jobs/7530775761#step:10:267
Code to reproduce issue
If needed:
"@percy/cli": "1.18.0",
to"@percy/cli": "1.20.1",
in package.jsonnpm i && npm run test
Beta Was this translation helpful? Give feedback.
All reactions