Questions tagged [requirejs]

Denotes questions related to require JS. RequireJS is a JavaScript file and module loader. It is optimized for in-browser use, but it can be used in other JavaScript environments.

Filter by
Sorted by
Tagged with
0
votes
0answers
10 views

Firebase undefined

I'm trying to build a cloud messaging module working with firebase. I have followed the magento dev docs tutorial on how to implement 3rd party javascript resources, I used requirejs. And yet, ...
0
votes
0answers
15 views

Magento2.3: The attribute 'data-requiremodule' is not allowed

I upgraded the Magento version 2.1 to 2.3, the following error has occurred in the backend. 1 exception(s): Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'script', ...
0
votes
0answers
13 views

Update Magento 2 jquery-ui.js version in Custom Theme

Is there a way to override Magento 2 lib\web\jquery\jquery-ui.js version in my Custom Theme? I want to upgrade it to version 1.12.1.
0
votes
1answer
38 views

Magento 2 how to add Materialize javascript in Magento 2?

I have tried to add materialize js to Magento 2 but it does not work. I have my materialize js in theme/web/js. then I have the requirejs-config.js in theme/ this is the code: var config = { //...
0
votes
0answers
17 views

Loading js in adminhtml after the page is totally rendered

I'm using custom module to work in Magento 2 admin catalog page to implement some js stuffs. My js is working but it loads before the dom loads in adminhtml. require(['jquery','domReady!'], function ...
0
votes
0answers
17 views

Error After Installing Website in magento 2 js

I just installed magento 2 and I come across a bug that won't let me get lost on my admin page i use : Nginx Php7.2 Varnish 4 and Percona Server on Debian 9 I believe the problem is in the ...
0
votes
0answers
30 views

Javascript problem When changing production mode

I have this console error that occurs only when setting to production and nothing works as expected in storefront view. It works fine when the mode is set to the developer and no console errors are ...
0
votes
0answers
10 views

Magento 2 menu.js doesn't get loaded

The page contains the following HTML Element: <ul data-mage-init='{"menu":{"responsive":true, "expanded":true, "position":{"my":"left top","at":"left bottom"}}}'> The file requirejs-config.js ...
2
votes
1answer
48 views

Error require.js

I tried to put jquery, and then it shows the errors below... {MyTheme}/Magento_Theme/layout/default_head_blocks.xml <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/...
1
vote
1answer
37 views

How to customize validate-product.js, so it will return message in popup?

If a customer forgets to choose the product option of the configurable product on the product listing page and click "add to cart" it is redirecting you to the product view page with the message: "You ...
0
votes
0answers
24 views

After upgraded Magento 2.1.8 to 2.3.3 all JS code not working on frontend

Hello, Guys! How i can fix problem with JS code on frontend? bin/magento static content deploy s:s:d -f I see that require.js file no generated in directory pub/. Maybe someone means what is ...
1
vote
0answers
59 views

Advanced JS Bundling - What to include/exclude

So, I've been doing an advanced js bundling for my website and I've read a lot of information about it. I've decided to use m2 dev tools to help me do it, however, I've some doubts with the result I ...
1
vote
1answer
32 views

js files are automatically deleted - adminhtml/web/js/components/use-parent-settings

In my M 2.2.6 I can not enter the Category section of dashboard, the spining is turn around. When I check the console, some of JS has 404 error In - adminhtml/web/js/components/use-parent-...
0
votes
0answers
8 views

How to create a local callback to a JS via CDN using RequiredJS?

I've some JS files included in my themes and modules, but sometimes these files are not loaded, becaused of adblock or CDN server down. I checked the RequireJS documentation and I saw that it's ...
3
votes
2answers
49 views

What is the difference of map vs path?

What is the difference between map vs path when building a theme / module? Which are the restrictions? var config = { map: { '*': { 'jqueryjs': 'India_Newtheme/js/jquery', '...
0
votes
0answers
21 views

Why is it adding a min extension to the JS path getting a 404?

I'm requiring an external JS file via requirejs-config.js but my Magento 2.3.2 is getting with .min included, but there is no this .min, so I'm receiving an error 404, I don't want to move it to my ...
0
votes
0answers
17 views

Magento 2 mixin error

I didn't use mixin in my custom theme or anything. But I get the below error. TypeError: mixin is not a function My require-config.js is below. var config = { paths: { 'owl.carousel': '...
0
votes
0answers
99 views

Magento 2 rewrite widget function with mixin return an error

I have to add few lines on js functions but mixin not working. app/design/frontend/Konect/base/Magento_ProductVideo/requirejs-config.js var config = { config: { mixins: { '...
0
votes
0answers
27 views

Magento 2 Remove Javascript from requirejs in child theme

We're extending the Magento_Blank theme to create our own child theme. Magento_Blank includes some js via require_js theme.js and responsive.js` which are not required. I cannot figure out how to ...
0
votes
1answer
90 views

How to properly create mixins in Magento 2 JS?

Hi I'd like to know what is the best way to create mixins in core required-js. Instead of copying this files to working theme and make changes: vendor/magento/module-product-video/view/frontend/web/...
1
vote
1answer
26 views

How to add a JS Component via XML?

How could I add a new JS Component, using required and following the Magento's pattern via an XML which I can determine a unique page (e.g. using a checkout_index_index.xml) I don't want to create a ...
0
votes
2answers
61 views

how come this override doesnt work magento 2

var config = { "map": { "*": { "Magento_Checkout/js/model/shipping-save-processor/default": "module_name/js/shipping-save-processor/default-override" } } }; var ...
4
votes
0answers
85 views

How to add custom validation for Street 1 in Checkout page > Add shipping address in Magento 2.2.8?

How to add custom validation for Street 1 in Checkout page > Add shipping address in Magento 2.2.8 ? I want to apply custom validation on Street 1 field and I have tried below things. Method 1 I ...
0
votes
0answers
55 views

Magento 2 Admin Broken

I've got a Magento 2 dev installation all setup, I've pulled from my repo and setup the site. The frontend seems to be working OK, I can see information being pulled from the database. The issue is ...
0
votes
2answers
411 views

How to load JavaScript after Ajax has loaded?

I have a custom payment module and I am trying to show a message on the payment page using jQuery. My JS file is being called on the shipping page but not when the user clicks on the next step and ...
0
votes
0answers
104 views

Error while using croppie.js library in magento 2

Trying to use the croppie library on product detail page and sometime it works perfectly but most of the time it throws one of these errors. TypeError: priceBoxes.priceBox is not a function ...
1
vote
1answer
87 views

Magento 2 pass data from template phtml to js file

I want to call an ajax function on a button click. All other things are working fine. But I can't read the parameter which is passed to the js. How can I do it? Here is my code. Phtml file <...
0
votes
0answers
11 views

JS component returning object does not run object's function where key matches component name

According to Magento 2 documentation, when building a JavaScript component: If an object is returned, the initializer tries to find the key. If the corresponding value is a function, the ...
0
votes
0answers
60 views

Magento 2: Advanced JS Bundling Automate

I am implementing Advanced JS Bundling in my Magento 2.3.2 EE store. The part in which we create build.js on root by combining nodes of deps, shim, paths, and map from requirejs-config.js . I want to ...
0
votes
0answers
30 views

Magento 2: Simple case scenario, what to use? RequireJs , UI, JavaScript ? help from a backend developer

I have been doing a magento 2 course and it's more centered around backend development, but I would like to know what to apply for a simple case scenario. Case scenario : When I visit a specific url, ...
1
vote
0answers
32 views

Magento2: Getting Random Javascript errors in console

I am getting error on live website. Everytime i encounter with new error in console.Few of them shown below: Let me know how to solve it.
0
votes
0answers
18 views

keep extend Magento_Ui/js/form/element/wysiwyg but remove component dependency

I just want to extend almost content (not duplicate content to second file). And only remove component 'Magento_Variable/variables'. For reason i don't want to use variables in wysiwyg Is there a way ...
0
votes
1answer
42 views

Magento2: How to call js function in custom file

I want to call a particular third party js function in my custom js file. XXX/YYY/view/frontend/web/js/view/payment/method-renderer/cashondelivery-method.js. define([ 'Magento_Checkout/js/...
1
vote
2answers
51 views

Magento 2.3.X Custom Module JavaScript won't load with require.js

I am building a module, and the HTML loads fine, but the JS isn't. Here is what I have: Vendor Name: NewShop Module Name: HelloWorld File: app/code/NewShop/HelloWorld/view/frontend/requirejs-config....
0
votes
0answers
52 views

How we can use Js Mixins for order scripts.js

I want to override switchPaymentMethod from module-sales/view/adminhtml/web/order/create/scripts.js for that I use mixins: app/code/Vendor/Module/view/adminhtml/requirejs-config.js var config = { ...
0
votes
4answers
853 views

TypeError: require.config is not a function in Magento 2

Js, CSS is not loading properly.
0
votes
0answers
84 views

Magento2 slick slider issue on page load

I am applying slick slider on the home page at widget but on page load, it is not loading properly but after page load, ends it works fine and when the page loads completely it looks like this ...
1
vote
2answers
36 views

How to add custom JS in admin Magento 2

I'm trying to add a custom js file in magento 2 in the admin but all I can see are sample on how to add in the frontend. I found some that shows how to add in admin but none works. Below are my code ...
0
votes
1answer
67 views

Third Party JS not Working using require js Magento 2.3.2

We are trying to create new Theme in Magento2. We have a problem in executing third party js file. requirejs-config.js file configuration var config = { deps: [ "js/default" ], paths: { ...
0
votes
1answer
47 views

Add Js code for Google measuing checkout in checkout

I want to measure checkout page using tag manager Enhanced Ecommerce. I refered https://developers.google.com/tag-manager/enhanced-ecommerce#checkout. How to add this script. Thanks.
0
votes
3answers
328 views

Magento2.3: How to exclude 3rd party .js from minification

I have read this https://github.com/magento/magento2/issues/5835 and this Exclude custommodule Js from minification of Js in Magento2 and this https://github.com/magento/magento2/pull/13687 and I ...
0
votes
0answers
32 views

Error while extending jQuery widget

I'm trying to extend the widget in vendor/amasty/label/view/base/web/js/label.js and override a functionality in one of its methods. The error I get is: TypeError: base is not a constructor in ...
0
votes
1answer
36 views

On load of page click trigger only once

I have used the following script in a .phtml file require([ 'jquery' ], function ($) { $('#update-shipping-method-submit').trigger('click'); }); My issue is after loading of ...
0
votes
1answer
50 views

Surveyjs with magento2

I am integrating survey js with Magento 2. Referring the below link. https://surveyjs.io/Documentation/Library/?id=Add-Survey-into-your-Web-Page But facing an issue: Uncaught ReferenceError: ...
2
votes
1answer
79 views

If script is includeed from default_head_blocks.xml error is noticed

I am developing a site in magento 2.3 flurys.digifrizz.com If script is included through default_head_blocks.xml there are lots of require js error noticed <page xmlns:xsi="http://www.w3.org/2001/...
0
votes
0answers
33 views

How to solve Magento2.3.2 optionConfig[optionValue].prices undefined?

I have a custom module creating a custom option group for products. I managed to have the admin and frontend display working, I can see the custom options checkboxes and I can select them in the PDP ...
1
vote
2answers
46 views

How load only the required JS based on page?

I created a cms blank page and i found that it loads 179 js scripts, that slow down page loading. I assume that the problem is the theme i'm using. I want that pages loads only the stricly necessary ...
0
votes
1answer
63 views

sectionLoadUrl error while updating cart price total Magento 2

I am updating the cart total price dynamically without page reload. I wrote code in js file require( [ 'Magento_Checkout/js/model/cart/cache', 'Magento_Checkout/js/model/cart/totals-processor/...
0
votes
0answers
24 views

How can I add custom heading in tiny mce 4 editor in Magento2?

I want to add custom heading in tinymce 4 editor in magento2. Is anyone having knowledge? like below screen shot.
0
votes
1answer
28 views

theme magento 2 not working

I installed magento 2 on my computer and I copied the code of the theme in the app\design and pub\ that works on the server but it does not work properly on my computer. Help

1 2 3 4 5 9