egjs-flicking
egjs-flicking copied to clipboard
Uncaught (in promise) TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
Description
I am currently seeing this error in Chrome (Version 91.0.4472.114 (Official Build) (x86_64)
) on the console with a barebones Vue 2 project. I'm using a Mac.
flicking.esm.js?5937:679 Uncaught (in promise) TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
at getStyle (flicking.esm.js?5937:679)
at VuePanel.__proto.resize (flicking.esm.js?5937:4403)
at eval (flicking.esm.js?5937:3916)
at Array.forEach (<anonymous>)
at VueRenderer.__proto.updatePanelSize (flicking.esm.js?5937:3915)
at Flicking.eval (flicking.esm.js?5937:6259)
at step (flicking.esm.js?5937:187)
at Object.eval [as next] (flicking.esm.js?5937:11
Is this a bug? or is there something wrong with my setup?
Steps to check or reproduce
- Node v12.22.1
- Pull down the branch
-
npm install
-
npm run serve
- open chrome console and see the above error.
The reply may be delayed because member is on vacation. :)
@robjewell-ibotta
There was a problem with the dependency.
Would you like to delete package-lock and node_modules and reinstall? I tested it locally and it passed.
@mixed haha that member has been doing a great job so they need a break!
@daybrush thank you for your reply! indeed deleting the package-lock and node_modeuls and a reinstall fixed the problem. What was the problem exactly? Was the incorrect version of flicking not installed?
@robjewell-ibotta
it's not a flicking issue, it's a vue issue.
vue-flicking -> vue-property-decorator -> vue version and
This is different from your app's vue version. This is a problem with package-lock.
@daybrush are you saying that this vue version in package.json does not match the version specified in package-lock.json? Is this mismatching of versions creating the error?
@robjewell-ibotta
Similar. installed more than one vue.
The app's vue and flicking's vue are different.
@daybrush thank you for the correspondence -- if you are based in the Republic of Korea, then it's very late over there π ! I will have a closer look at this later to make sure I fully understand.
I have this problem with react, rm node_modules not working
I have the same problem with react. Remove node_modules
not working. But it's working when I downgrade the version from 4.1.1
to 3.7.1
. Does the new version have any breaking changes?
@joneldiablo Sorry I didn't check your comment! Can I get a sample code or link to the repository that can reproduce this issue?
@quyctd The new major version has some breaking changes that you can check on this link
- https://naver.github.io/egjs-flicking/docs/migration-from-v3 If that doesn't solve your issue, can I get a sample code that reproduces this issue or a source code of yours? (If possible)
@WoodNeck I created a sample code here: https://github.com/quyctd/egjs-flicking-issue. Please check it when you have time π
@quyctd I've just checked your repository and looks like it requires ref forwarding to resolve that issue. As Flicking should find an actual element that React renders, the panels should be either a JSX element or JSX ref-forwarded component.
You can see how to resolve that issue on our quick start page (click React):
- https://naver.github.io/egjs-flicking/docs/quick-start
Basically, you can either use React's ref forwarding to the actual element (img) or use useFindDOMNode
.
See "Using the components as a panel" and "Bypassing ref forwarding" section, then choose what's best for your situation :)
@WoodNeck Thank you, it's worked π
Hello I have the same issue and all suggestions writen above doesn't solve it I'm using Vue ^2.6.14 and Flicking 4.4.2 I've tried :
- to downgrade
4.4.2
to3.7.1
- to add props
:viewport-tag="'div'"
- to use a component instead of a div the panel
- to add
:key
for each panel
Thanks for your help regards
Hello @Ricozor! Can I get a link to a repository or somewhere that can reproduce this issue? :)
Hello @WoodNeck Happy new year ! Sorry for my late answer but I was in holydays.
I've install a Flicking slider + Vue 2 on sandbox to try to reproduce the bug but I can't reproduce it, and I can't share you the repository :( https://codesandbox.io/s/flicking-vue-2-test-26w9y If I have more time I will try to install a project from scratch to try to reproduce it localy and share the repository.
For me this problem occurs only when I attempt to generate children dynamically. I provide info how to reproduce in this StackOverflow question: https://stackoverflow.com/questions/71693351/generating-a-flicking-carousel-with-react-leads-to-the-getcomputedstyle-error
Ok for me actually https://naver.github.io/egjs-flicking/docs/quick-start has resolved it. Checked section Bypassing ref forwarding
and added useFindDOMNode={true}
to my Flicking.
This issue/PR has been automatically marked as stale because it has not had any update (including commits, comments, labels, milestones, etc) for 30 days. It will be closed automatically if no further update occurs in 7 day. Thank you for your contributions! νκΈ
μ΄ μ΄μ/PRμ commits, comments, labels, milestones λ± 30μΌκ° νλμ΄ μμ΄ μλμΌλ‘ stale μνλ‘ μ νλμμ΅λλ€. μ΄ν 7μΌκ° νλμ΄ μλ€λ©΄ μλμΌλ‘ λ«ν μμ μ
λλ€. νλ‘μ νΈ κ°μ μ κΈ°μ¬ν΄μ£Όμ
μ κ°μ¬ν©λλ€.
Did anyone find an actual solution for this?
help: vue 3
Still relevant, it appeared in our production.
Vue: 3.4.5
@egjs/flicking: 4.11.2
Hi naver/egjs-flicking!
Thank you for your message. Our team will reply to you very shortly and we'll update you by email.
You can log in and view your entire conversation history with us at anytime in our Help Center [https://adcash.kayako.com/conversation/view/203398].
Thank you!
Find us on social media:
[img src="https://crrepo.com/en/imgv5/mail/footer_facebook.png"
height="15" /] [https://www.facebook.com/AdcashGlobal] [img src="https://crrepo.com/en/imgv5/mail/footer_twitter.png" height="15" /] [https://twitter.com/adcash] [img src="https://crrepo.com/en/imgv5/mail/footer_linkedin.png" height="15" /] [https://www.linkedin.com/company/adcash] [img src="https://crrepo.com/en/imgv5/mail/footer_instagram.png" height="15" /] [https://www.instagram.com/adcash_global/]
Β© Adcash [https://www.adcash.com/]
Kentmanni 4 | 10116 | Tallinn, Estonia
www.adcash.com
[https://adcash.com/?utm_source=kayako&utm_medium=email&utm_campaign=logo]
The problem still exists in version 4.11.2. Bypass or temporal fix is useFindDOMNode={true}
Hi naver/egjs-flicking!
Thank you for your message. Our team will reply to you very shortly and we'll update you by email.
You can log in and view your entire conversation history with us at anytime in our Help Center [https://adcash.kayako.com/conversation/view/205583].
Thank you!
Find us on social media:
[img src="https://crrepo.com/en/imgv5/mail/footer_facebook.png"
height="15" /] [https://www.facebook.com/AdcashGlobal] [img src="https://crrepo.com/en/imgv5/mail/footer_twitter.png" height="15" /] [https://twitter.com/adcash] [img src="https://crrepo.com/en/imgv5/mail/footer_linkedin.png" height="15" /] [https://www.linkedin.com/company/adcash] [img src="https://crrepo.com/en/imgv5/mail/footer_instagram.png" height="15" /] [https://www.instagram.com/adcash_global/]
Β© Adcash [https://www.adcash.com/]
Kentmanni 4 | 10116 | Tallinn, Estonia
www.adcash.com
[https://adcash.com/?utm_source=kayako&utm_medium=email&utm_campaign=logo]