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
1
vote
1answer
65 views

css and js not found in magento 2.3.5

Refused to apply style from http://localhost/magento2-2.3.5-p1/pub/static/version1593595791/adminhtml/Magento/backend/en_US/extjs/resources/css/ext-all.css because its MIME type ('text/html') is not ...
1
vote
0answers
27 views

Magento2 JS override

How to override Plumrocket_CartReservation/js/prcr file in the local module not in theme var config = { map: { '*': { 'prcr': 'Plumrocket_CartReservation/js/prcr', '...
1
vote
1answer
32 views

How to find Which Module Giving this error : Uncaught TypeError: Constr is not a constructor

Every UI Grid generating this Error. This Error Only giving in Live Not in local instance, as well as Other Server. All the Instance same Code Same DB. How to find Which Module Giving this error?
1
vote
0answers
13 views

Is there a way to remove deps config in requirejs-config.js in the other module?

I'm following the steps in this article on a default Magento sample data version and I want to remove 'mage/translate-inline' ADM from injected into the page. See here - https://prnt.sc/t7ao6j Is ...
1
vote
0answers
13 views

Is it possible to generate a dependency graph of files included via RequireJS?

In Magento 2 lots of JavaScript files are loaded via RequireJS. Those files, themselves, can also require more JavaScript files, and so on. This can make it difficult to determine where a specific .js ...
2
votes
5answers
217 views

Cookiebot throwing console errors in Magento 2.3.4

I have added cookiebot script into head tag, here is the script <script id="Cookiebot" src="https://consent.cookiebot.com/uc.js" data-cbid="0000-0000-0000-0000" data-blockingmode="auto" type="...
1
vote
0answers
10 views

Magento 2 config CDN for specific file type only

Magento 2 allow to add another url for static views file, but all static file types will be requested to this url. I want to some only file types be served using that url. Example *.js and *.css ...
0
votes
1answer
66 views

Uncaught Error: Mismatched anonymous define() module: function(t,g,u)

I have a fresh installation of Magento but this error is showing on all of the pages.This may be duplicate of some other but I cannot find solution for my problem so asking here. When I trace back it ...
0
votes
2answers
27 views

Requirejs not finding third party file

I'm trying to include Firebase in my website, so I decided to include the dependencies through requirejs. Thing is requirejs can't find my files for some reason. What I first tried was to load the ...
0
votes
0answers
13 views

Uncaught SyntaxError: missing ) after argument list for all js files magento2

I have a fresh installation of magento 2.3.3. I want to move m2.2.7 database from to this installation instead of upgrade because there are many other issues in 2.2.7. I moved the db and extensions ...
0
votes
1answer
14 views

Magento 2: Location of uiRegistry.js file

I am mapping some files for advanced javascript bundling in Magento 2 and I am trying to find the file uiRegistry.js. Does anybody know where to find it? Thanks.
0
votes
2answers
57 views

data-mage-init breaks in cms static blocks or pages - how do i get an accordion?

I have been trying to have some blocks with collapsible content, but to put them in cms blocks so the text can be maintained by a normal human I have found, thanks to previous stack discussions, that ...
0
votes
0answers
10 views

Email template preview show balck page and error of http://requirejs.org/docs/errors.html#scripterror on console

When i try to review email template in m2 it show requiresJS error on console. i am attaching a screenshot of that error .Please find the attachement
0
votes
1answer
29 views

Custom Module load JS when all content is loaded in Checkout

I created a custom module to show suggested addresses when customer type in the address fill. However, the requirejs load before the content of checkout page load, even though I have put "domReady!". ...
0
votes
1answer
27 views

How to add external js script in block via requireJs?

What is the simplest way to add external js script like: https://sandbox-geowidget.easypack24.net/js/sdk-for-javascript.js on my page? I've created block which i render on my product page. But i get ...
0
votes
0answers
14 views

Magento 2: remove all default JS for custom theme

We are creating multiple websites in one magento 2 instance with a custom theme. Those websites are not supposed to be shops. They all are serving one simple page without any of magento's ...
1
vote
0answers
38 views

How to use if condition(knockout) in html template ? magento 2

How to use if / else condition in html template file ?
0
votes
1answer
25 views

Magento store optimization?

I am facing problem the total number of request send to server is 223 which is huge and due to which loading time is 13 seconds How can I reduce number of elements I have merged and minify JS and css
0
votes
0answers
18 views

How to take Product attribute value and pass in JS?

I want to get attribute value which is date and wants to pass it into JS file, I have my JS files linked up properly, basically I am displaying timer in product detail page and I want to display timer ...
-1
votes
1answer
28 views

Magento 2 - How to use jQuery $ in script injected with requireJs?

I try to include a script and use jQuery in it by using $ instead of jQuery THEME\Magento_Catalog\templates\product\view\gallery.phtml <script> require([ 'jquery', '...
0
votes
0answers
11 views

Issue : When my widget load , my Jquerry no more avaible

I try to add Widget on product page that is a calendar which use jquery in an another webservice . In my phtml i use file_get_content But when i do this my widget does load corectly but all my other ...
0
votes
1answer
19 views

Adding custom JS (Slick Slider) to Magento Custom Theme without overriding parent

I created a custom theme which is inheriting from the blank theme. Now I wanted to integrate Slick and found this article which I followed https://inchoo.net/magento-2/magento-2-slick-carousel/ My ...
0
votes
0answers
14 views

Include prompt widget in the mass action from Magento 2

My goal is to include a promp widget before choosing an option value from the mass action from the product grid. Here is my code so far: Vendor/ProductBarcode/view/base/web/requirejs-config.js : var ...
0
votes
0answers
27 views

Magento 2.3.4 admin not saving

Good day, From magento ce 2.3.4 admin just in configuration module I can not save or saving button is not working: a) Firefox most of the time not working B) google chrome sometimes not working c) ...
2
votes
2answers
84 views

Why is the loading of scripts via RequireJS incredibly slow when they are not cached?

First of all, this is not a question about general Magento 2 performance. I'm already aware of how to speed up Magento 2, in general. My question is specifically about RequireJS and the assets served ...
0
votes
2answers
38 views

cannot find my custom js file

I have created under app/code/vendor/theme/view/frontend/layout/defaul.xml an file called default.xml and i have following content in it: <?xml version="1.0"?> <page xsi:...
0
votes
3answers
73 views

Magento 2.3 How to check that customer is logged in using Js

I want find the whether the customer is logged in or not using Js. I got some links but it dosen't works and i not good at knockout js. Please give solution with brief explanation Referred Link : ...
0
votes
1answer
41 views

Map multiple js files in requirejs

I want to include yahoo.js and yahoo-calendar.min.js from my custom module yahoo.js yahoo-calendar.min.js basically i need to call the function from yahoo-calendar.min.js which require yahoo.js ...
2
votes
1answer
139 views

How to Override 3rd party module requirejs-config.js film in my custom module?

The above one is the 3rd party module's require-config.js. It contains the js file inside the adminhtml/web/js. I want to override that. So I created a custom module and made changes in the require-...
1
vote
0answers
42 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
1answer
116 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
24 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
78 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
12 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
54 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/...
0
votes
1answer
74 views

Enable zoom feature in custom template in Magento 2

I am creating zoom feature on images in my custom template, app/code/Vendor/Module/view/frontend/requirejs-config.js var config = { paths: { 'custom_zoom': 'Vendor_Module/js/jquery.zoom.js'...
1
vote
1answer
86 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 ...
1
vote
0answers
198 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
40 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
10 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
72 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
23 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
33 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
234 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
58 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
253 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
28 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 ...

1
2 3 4 5
10