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

Denotes questions regarding Magento 2 requirejs-config.js

0
votes
0answers
17 views

Magento 2 Remove JS added with Requireconfig-js

I added some custom javascript for a custom module using the requireconfig-js file. Now that I've removed those files due to errors, I now get errors saying that the files cannot be found. I don't ...
0
votes
1answer
14 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
45 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: '...
4
votes
2answers
163 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
27 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
77 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
16 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
86 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
35 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
27 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
35 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 . ...
2
votes
1answer
37 views

How can we load js to a custom module created?

Can you please suggest us how to load js into the custom module created? We are facing issues in loading the js to our custom module created
1
vote
0answers
225 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
160 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
100 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
65 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
190 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
81 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
84 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
64 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
69 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
304 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
37 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
54 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
63 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
325 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
133 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
86 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
369 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/...
2
votes
2answers
1k 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
68 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
277 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: [ "...