Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [requirejs-config.js]

Denotes questions regarding Magento 2 requirejs-config.js

1
vote
1answer
31 views

Porto - include Mageplaza LayeredNavigation in js file

I'm making a custom theme based on porto. I'd like to include the Mageplaza_LayeredNavigation/js/view/layer in the toolbar.js file of the the Magento_Catalog module, in my custom theme. I tried ...
0
votes
0answers
8 views

I am getting an Mismatched annonymus define mdule() False error in the magento 2.3.0

Hi Sometimes it happens that my page information doesn't displayed anything, but when page reload once the information on the page get displayed. On the cross check of browser consol I am getting an ...
0
votes
0answers
17 views

JS Errors after changing deploy mode developer to production

I simply change my application mode form developer to production. php bin/magento deploy:mode:set production Result- Deployment of static content complete Disabling maintenance mode Enabled ...
2
votes
1answer
16 views

Why isn't Magento 2 recognizing my library in requirejs-config.js?

This is Library location app\design\frontend\user\theme\web\js\owl.carousel.min.js this is my config js file app\design\frontend\user\theme\requirejs-config.js var config = { deps: [ "js/...
2
votes
1answer
46 views

Magento 2.3.0 add custom JS in theme, using require js

I want to add a custom js - pricing.js in my theme folder using require js I call the script in defaultheadBlock.xml <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
1
vote
0answers
452 views

magento 2 Uncaught TypeError: Cannot read property 'version' of undefined

I got below error randomly in front-end and when all modal popup not working when below error occurs. Uncaught TypeError: Cannot read property 'version' of undefined I have override admin product-...
0
votes
1answer
25 views

How can I use Highcharts graphs in magento2 custom module customer account section in the standard/recommended way with require js?

I need to use the Highcharts.com simple line graph by adding its library with requirejs-config.js in frontend luma theme, custom module in customer account section. I have tried these solutions but ...
0
votes
1answer
94 views

Magento 2 : Use of shims in requirejs-config.js file

Can anyone explain me what is the use of shims dependencies in requirejs-config file? Doing much of research but I hasn't found exact answer for this.
1
vote
0answers
54 views

Magento 2 - problem with mCustomscrollbar.js

Since few days i try to fix issue with my mCustomScrollbar plugin and i got stuck. First of all i i've got library with mCustomScrollbar.js and mousewheel.js in web/js/mCustomScrollbar and my ...
2
votes
1answer
121 views

How to override mini-cart default template html file?

I have Magento 2.2.4 version, And I want to overwrite Magento_Checkout/template/minicart/item/default.html file in my custom module. For this, I created require-jsconfig.js file at below path /app/...
2
votes
0answers
27 views

I have added js using require js but it is not attached

I have added javascript files in require js but it is not showing in the inspect element that my javascript files are attached and it is not working. What should I do? I have cleared cache and folders ...
0
votes
1answer
54 views

How can I get the locale inside a requirejs-config file?

I am trying to add a googlemaps path to my requirejs-config file, but I need to put the locale on the end of the string. Here is what my requirejs-config file looks like. I need a way to get the local ...
0
votes
2answers
255 views

ReferenceError: jQuery is not defined Magento 2

I created a countdown using JS. For that i need jQuery so I created requireJs file. var config = { paths: { 'countDown': "ABC_CoundDown/js/countDown" }, shim: { 'countDown': { deps: ['...
0
votes
1answer
56 views

map js url not loading magento2

we have a site that was running fine, we just move site to new instance and got an error. All js file's map urls, that we define in require-config.js file not loading on frontend. Like, we define - ...
0
votes
1answer
67 views

Requirejs-config.js not working for parent theme's responsive.js file

I would like to change the values for the media property for the files menu.js & responsive.js from media: '(min-width: 768px)' to media: '(min-width: 992px)'. I thought using Magento's JS Mixin ...
0
votes
1answer
75 views

Use of non-amd jquery plugins with requirejs without modifying them?

I recently searched a lot on use of non-amd jquery code with requirejs but couldn't find a proper way to do it. To be more specific, I want to use pana-accordion.js found at below mentioned url. ...
2
votes
1answer
87 views

jquery plugin error “Uncaught TypeError: $(…).[plugin function] is not a function”

I am using Magento 2.2.6 and I am trying to include a jquery plugin (stickybits, in this case). The jquery plugin file is successfully called in my requirejs-config.js file and I can see that the file ...
0
votes
1answer
162 views

How to Load JS Code at the Top Using RequireJS

How can I load a custom JavaScript file using RequireJS at the very beginning? Please note: The key is that RequireJS must load my script FIRST, before any other scripts, as the rest of my script ...
0
votes
0answers
81 views

Remove calendar.js only from Magento 2 default homepage?

Do I want to Remove calendar.js from Magento 2 luma theme homepage? If I remove require.js from custom module it removes calendar.js and other all. Also, Can I remove the mapping of calendar.js from ...
2
votes
2answers
278 views

How to include external JS in adminhtml using requirejs-config.js

I try to include external JS (fabric.js) in my custom module. I try so many different way but still not getting success. i don't understand what i missing below is my code. Add external JS (fabric....
0
votes
1answer
318 views

Magento 2 Remove JS added with requirejs-config.js

Edit So after removing the pub/static folder and also removing the .htaccess file with it and breaking my site I'm finally back to where I was. Still having issues with JS files that don't exist but ...
0
votes
1answer
122 views

Datatable js include issue in magento2

I am including datatable plugin to my custom module. I tried in this way, below is the code of my Vendor/Module/view/frontend/requirejs-config.js var config = { map: { '*': { ...
2
votes
1answer
52 views

Why does one script work but not the other in require.js?

I am trying to add a live chat script to my Magento 2 site. I had previously added slick.js to my Magento 2 site and the require-config.js file looked like this- var config = { paths: { slick: '...
5
votes
2answers
605 views

what is requirejs-config.js in Magento2?

Can any one tell that what is the difference between the keywords that are used in requirejs-config.js like 'map','paths','shim' and 'deps' please elaborate exact difference if possible with example? ...
1
vote
1answer
238 views

Magento2 override module-ui base admin template file?

i want to override following file in my custom module so that when magento admin sales grid renders this template from vendor it would take file from my module: vendor\magento\module-ui\view\base\web\...
3
votes
2answers
305 views

Constr is not a constructor on layout.js line 137 error custom module

I have gone through this posts and tried to implement the answers and suggestions Magento2 getting 'Constr is not a constructor' error for custom theme && Error in layout.js, cart ...
0
votes
1answer
185 views

requirejs ! bootstrap.min is not loading in Magento2

I am doing theme integretion. I have included the bootstrap.min.js file in requirejs-config.js in requirejs-config.js file var config = { map: { '*': { 'jqueryjs': 'India_Newtheme/js/...
1
vote
1answer
28 views

Minify js in magento2

I have added script in phtml file for faq (cms page). <script> require([ 'jquery', ], function ($) { $(".faqs-question").click(function () {console....
0
votes
0answers
260 views

Require JS in Internet Explorer 11

define([ 'uiComponent', 'My_Module/js/test/model' ], function (Component, model) { var methods= { ....... model.proceed(data); }; return Component.extend(methods); } the above JS ...
0
votes
0answers
204 views

How to solve jquery issues in Magento 2?

I am using Magento 2.2.3 and I have created customtheme But in my website scripts are not working properly.It gives me below error: ReferenceError: jQuery is not defined I have added requirejs-...
0
votes
0answers
52 views

Product addto cart in view page

I have to initialize js for a form in view page, Its working perfect in desktop. But in the mobile theme when I tried to add-to cart for the product, I'm able to get the js for product addtocart . ...
1
vote
0answers
582 views

Magento 2 load external script in my custom page

I want to add an external script to my store. I have added the script in my phtml file and it is working fine. But I want to follow the magento EQP validation. Here is my working code my layout xml &...
2
votes
1answer
222 views

Requirejs urlArgs paramater in the requirejs-config.js file redirects all the min.js file requests to full .js file urls

I have enabled the production mode in my Magento 2.2.4 version, disabled the static sign functionality and added the parameter: urlArgs:"version='test'" in requirejs-config.js file. I have enabled the ...
0
votes
0answers
290 views

Select2 / Selectize JS does not start domReady! - RequireJs

I have add my requirejs-config.js app/design/frontend/Altravista/my_theme/requirejs-config.js var config = { deps: [ 'js/custom' ], paths: { 'select2': 'js/select2/...
0
votes
0answers
219 views

matchHeight is not a function when called via requirejs-config

I am working to put matchHeight on my website with require.js - however I am getting the following error: I have a requirejs-config.js in my theme folder app/design/frontend/Vendor/Theme: var config ...
1
vote
2answers
591 views

Magento 2 Passing Php Variable to external js for custom theme

I have created a custom theme in app/design/frontend/Vendor/Themename In theme directory I have Themename/requirejs-config.js var config = { deps: [ "js/custom", ] }; Themename/web/js/...
1
vote
1answer
297 views

pub/static/_requirejs is not being created in magento 2 version 2.2.4

i am trying to include slick plugin into magento 2 through custom theme by requirejs but pub/static/_requirejs folder + files are not being generated on code deploy. file structure is following: /app/...
0
votes
1answer
258 views

Magento 2 : Override 'Magento_Checkout/js/view/billing-address.js' with Custom JS

I want to override Magento's Magento_Checkout/js/view/billing-address.js with my custom JS file, for that I have added below code in my requirejs-config.js var config = { map: { "*": { ...
0
votes
2answers
413 views

i have added the custom js in the magento 2 module but giving 404 error in static folder!

I've added all thing like require-js and script in custom but not worked.Please show me path with correct example of bootstrap in Magento 2. my require-config.js is var config = { map: { ...
2
votes
2answers
117 views

how to i add a javascript file in magento 2 module and how to call it in phtml?

I try to add custom java-script file but giving error of different kind, please give me a proper example of adding JS in Magento 2 module and use it in phtml.
0
votes
1answer
828 views

Magento 2 is not reading my requirejs-config.js

I am trying to add slick.js to my website. I started by following this tutorial- http://inchoo.net/magento-2/magento-2-slick-carousel/ I have my slick.min.js here- >app/design/frontend/vendor/theme/...
1
vote
0answers
99 views

Add 2 jquery libraries to magento 2

Im trying to load more than 1 jquery library into the Magento theme, but the 2nd trigger for flickity seems to error Uncaught TypeError: $(...).flickity is not a function at HTMLDocument. (...
1
vote
1answer
86 views

How do i add Static files (styles and scripts) Magento 2 via AWS lightsail [duplicate]

Looking for some help here regarding adding styles and scripts(.css, and .js files) to a header on my page. I know that i have to be on developer mode to do this but i don't know where i have to put ...
2
votes
1answer
903 views

Return all JS functions via requirejs

In my exemple, i have just one function and I call it in phtml on passing the name function as param require(['jquery', 'module'], function($, hello) and it works fine. Now if i want to return 10 ...
1
vote
2answers
550 views

Add js to module via requirejs doesn't work?

Does someone knows why it doesn't work ? app/code/Vendor/Module/view/frontend/requirejs-config.js var config = { map: { '*': { module: 'Vendor_module/js/go', } } }...
2
votes
1answer
270 views

Magento 2: How do I rewrite JS from Third Party loaded through requirejs-config.js

Lets say we have an Third Party Module in Magento 2 that has in frontend from requirejs-config.js the following code: var config = { map: { '*': { amShopbyFilterAbstract: 'Amasty_Shopby/...
1
vote
1answer
782 views

Magento 2 - Extend catalogAddToCart widget

What i am trying to do is extend the catalogAddToCart widget so i can write some custom code without modifying the widget itself. So I've doen the requirejs file here: Vendor/default/...
3
votes
2answers
3k views

Magento 2 - Require Js not a function error

Firstly, yes I'm in developer mode - and yes i've got the caché turned off and flushing it ( i've also deleted pub/static a fair few times ). My issue: I have an extension which adds a page to the ...
0
votes
0answers
108 views

How to re-initialize requirejs after append HTML content into document? [duplicate]

I try to added HTML + RequireJS to DIV tag via ajax loading. With content contain tags like <script type="text/x-magento-init"> or data-mage-init attribute, It's easy to bind event using $('#...
1
vote
1answer
475 views

How to use 2 third party jquery plugins in one custom module Magento 2

Slick for slider. Fancybox for Custom HTml forms ( SignIn,signUp ...) In /var/www/html/magento2/app/code/Custommodule/ReviewRating/view/frontend/requirejs-config.js var config = { deps: [ "...