- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2016
06:38 AM
11-23-2016
06:38 AM
Require JS shim and third party script
I'm trying to include blockUI javascript in my extension, and I added this code
var config = { paths:{ "blockUI":"Mypackage_Mymodule/js/jquery.blockUI.js" }, shim:{ 'blockUI':{ 'deps':['jquery'] } } };
But keep getting this error:
Error: Script error for: blockUI http://requirejs.org/docs/errors.html#scripterror
Not sure what I'm doing wrong here
Labels:
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2016
08:02 AM
11-25-2016
08:02 AM
Re: Require JS shim and third party script
var config = { paths:{ "blockUI":"Mypackage_Mymodule/js/jquery.blockUI" }, shim:{ 'blockUI':{ 'deps':['jquery'] } } };
You have to remove .js file extension from js declaration.
You have to replace Mypackage_Mymodule/js/jquery.blockUI.js with Mypackage_Mymodule/js/jquery.blockUI in above path declaration in requirejs-config.js file.
Thanks.
If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial
Magento 2 Blogs/Tutorial
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2017
05:20 AM
05-29-2017
05:20 AM
Re: Require JS shim and third party script
@jstrez77 Please let me know if you have issue regarding requirejs file.
Thanks.
If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial
Magento 2 Blogs/Tutorial