naver / egjs-flicking

🎠 ♻️ Everyday 30 million people experience. It's reliable, flexible and extendable carousel.
https://naver.github.io/egjs-flicking/
MIT License
2.74k stars 128 forks source link

Uncaught (in promise) TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'. #485

Open robjewell-ibotta opened 3 years ago

robjewell-ibotta commented 3 years ago

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

  1. Pull down the branch
  2. npm install
  3. npm run serve
  4. open chrome console and see the above error.
mixed commented 3 years ago

The reply may be delayed because member is on vacation. :)

daybrush commented 3 years ago

@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.

robjewell-ibotta commented 3 years ago

@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?

daybrush commented 3 years ago

@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.

robjewell-ibotta commented 3 years ago

@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?

daybrush commented 3 years ago

@robjewell-ibotta

Similar. installed more than one vue.

The app's vue and flicking's vue are different.

robjewell-ibotta commented 3 years ago

@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.

joneldiablo commented 3 years ago

I have this problem with react, rm node_modules not working

quyctd commented 2 years ago

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?

WoodNeck commented 2 years ago

@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

quyctd commented 2 years ago

@WoodNeck I created a sample code here: https://github.com/quyctd/egjs-flicking-issue. Please check it when you have time πŸ‘

WoodNeck commented 2 years ago

@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):

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 :)

quyctd commented 2 years ago

@WoodNeck Thank you, it's worked πŸŽ‰

Ricozor commented 2 years ago

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 :

Thanks for your help regards

WoodNeck commented 2 years ago

Hello @Ricozor! Can I get a link to a repository or somewhere that can reproduce this issue? :)

Ricozor commented 2 years ago

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.

marekyggdrasil commented 2 years ago

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

marekyggdrasil commented 2 years ago

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.

stale[bot] commented 2 years ago

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일간 ν™œλ™μ΄ μ—†λ‹€λ©΄ μžλ™μœΌλ‘œ λ‹«νž μ˜ˆμ •μž…λ‹ˆλ‹€. ν”„λ‘œμ νŠΈ κ°œμ„ μ— κΈ°μ—¬ν•΄μ£Όμ…”μ„œ κ°μ‚¬ν•©λ‹ˆλ‹€.

soyekeye commented 2 years ago

Did anyone find an actual solution for this?

kostia7alania commented 1 year ago

help: vue 3 telegram-cloud-photo-size-2-5341476206006092339-y

negezor commented 7 months ago

Still relevant, it appeared in our production. Vue: 3.4.5 @egjs/flicking: 4.11.2

soyekeye commented 7 months ago

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]

samyan commented 7 months ago

The problem still exists in version 4.11.2. Bypass or temporal fix is useFindDOMNode={true}

soyekeye commented 7 months ago

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]