Stack Exchange Network

Stack Exchange network consists of 174 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

0
votes
1answer
37 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. ...
0
votes
1answer
31 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
64 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
38 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
85 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
96 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
28 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
51 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
235 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
81 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
161 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
48 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
23 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
185 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
84 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
35 views

Magento2: Custom Javascript Library not working for slider

I know someone will reply that this is a duplicate question and refer plenty of StackOverflow url. But trust me I have spent 24 precious hours of my life without any gain. I am about to complete my ...
0
votes
0answers
39 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
374 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
189 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
163 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
130 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
384 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
151 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
153 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
195 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
93 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
520 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/...
0
votes
0answers
58 views

Why is JQ `keyup()` not triggering field validation?

In Magento 2 input field are validated on keyup. We can also see that by inspecting an input field: valueUpdate: 'keyup'. I am trying to validate a field by not having to type in it. So I called JQ ...
1
vote
0answers
65 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
82 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 ...
3
votes
1answer
551 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
289 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
160 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
529 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
2k 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
85 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
364 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: [ "...