Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jquery.js:4095 Uncaught TypeError: Cannot read properties of undefined (reading 'parentNode') #1069

Closed
t28hk opened this issue Jul 15, 2023 · 4 comments

Comments

@t28hk
Copy link

t28hk commented Jul 15, 2023

Hi there, I used these steps install yii2 and yii2-grid,

$ composer create-project --prefer-dist yiisoft/yii2-app-basic
$ composer require kartik-v/yii2-grid "dev-master"
$ composer require kartik-v/yii2-bootstrap5-dropdown '@dev'

I created a controller, use kartik\grid\GridView show the grid, in chrome F12, Console, I get this error, I do not know why,
when I use yii\grid\GridView this error not show.

jquery.js:4086 jQuery.Deferred exception: Cannot read properties of undefined (reading 'parentNode') TypeError: Cannot read properties of undefined (reading 'parentNode')
at new Dropdown (http://test.com/assets/dd5f45e3/dist/js/bootstrap.bundle.js:3601:36)
at HTMLDocument. (http://test.com/country/index:525:2)
at mightThrow (http://test.com/assets/16e03fba/jquery.js:3802:29)
at process (http://test.com/assets/16e03fba/jquery.js:3870:12) undefined
jQuery.Deferred.exceptionHook @ jquery.js:4086
process @ jquery.js:3874
setTimeout (async)
(anonymous) @ jquery.js:3908
fire @ jquery.js:3536
fireWith @ jquery.js:3666
fire @ jquery.js:3674
fire @ jquery.js:3536
fireWith @ jquery.js:3666
ready @ jquery.js:4146
completed @ jquery.js:4156
jquery.js:4095 Uncaught TypeError: Cannot read properties of undefined (reading 'parentNode')
at new Dropdown (dropdown.js:98:34)
at HTMLDocument. (index:525:2)
at mightThrow (jquery.js:3802:29)
at process (jquery.js:3870:12)

Yii2 basic version 2.0.48.1, Bootstrap version 5.3.0

@matteo-cerioni
Copy link

I had the same problem, i fixed it downgrading "yii2-bootstrap5" package from version 2.0.4 to version 2.0.3

@t28hk
Copy link
Author

t28hk commented Jul 18, 2023

I had the same problem, i fixed it downgrading "yii2-bootstrap5" package from version 2.0.4 to version 2.0.3

I do the same way, downgrade yii2-bootstrap5 from 2.0.4 to 2.0.3, this error does not happen. This is the only way I can find so far.

@kartik-v
Copy link
Owner

kartik-v commented Jul 18, 2023

Related to issue #1056 and alternative workaround is described in the comment - its an issue with a breaking change in the yii2-bootstrap5 library...

@kartik-v
Copy link
Owner

This has been resolved via fixes provided to #1056.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants