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 import issue #915

Open
umpirsky opened this issue May 16, 2023 · 0 comments
Open

jQuery import issue #915

umpirsky opened this issue May 16, 2023 · 0 comments

Comments

@umpirsky
Copy link

If you write following code in https://github.com/Sylius/Sylius-Standard/blob/1.12/assets/admin/entry.js:

import $ from 'jquery';
import './product-bulk-update';

$(document).ready(() => {
    $('#confirmation-modal').modal('show');
});

You will get this error:

Uncaught TypeError: jquery__WEBPACK_IMPORTED_MODULE_0___default()(...).modal is not a function
    <anonymous> entry.js:5

The workaround is removing jquery import:

- import $ from 'jquery';
import './product-bulk-update';

$(document).ready(() => {
    $('#confirmation-modal').modal('show');
});

Not sure what the solution is, probably some webpack config that prevents double jQuery import.

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

No branches or pull requests

1 participant