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.
527 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
0
answers
46
views
Magento 2 how to avoid loading of certain js files on checkout page via requirejs?
I want to load certain js files on all pages except checkout page.
How can I add a condition in requirejs-config.js file not to load js files when user is on checkout page?
In the code below, I want ...
0
votes
1
answer
67
views
Magento2.4.7: How to get checkout error messages?
let's assume I want to run a function when I click on place order.
I'm doing some functionality on the Place Order button click, but my functionality still works if there's an error.
Is there a class ...
0
votes
0
answers
153
views
Js files issue in production mode magento2.4.6-p3
Site is working fine in developer mode but when we put the site in production mode there are different files showing 404 in console and these seems default files of magento but the path of the file ...
0
votes
1
answer
513
views
Magento2 | Reduce JS files to optimize site performance
I am trying to figure out how I can exclude some js files that Magento2 loads and makes it so heavy however without compromising the functionality of the site.
On my site with Magento2 I have a lot of ...
2
votes
0
answers
72
views
How to integrate Google Pay library into website?
I'm trying to integrate Google Pay into my Cart page. But, I always get an error, it looks like this:
Uncaught Error: Script error for "https://pay.google.com/gp/p/js/pay.js" https://...
0
votes
1
answer
92
views
How to prevent user sending requests frequently?
I believe it can be done with a PHP controller or JS cookie manipulation.
Help me with logic. For example, I want a user to send a request once every 2 minutes.
Let's pretend I've implemented some ...
2
votes
0
answers
653
views
Magento 2 : Codazon Fastest Theme js not loading propperly
I Have Installed Codazon Fastest Theme on my Manto2 site.i am facing an issue with js loading.
here is my system configuration below.
magento version : 2.4.5
PHP: 8.0
theme: Codazon Fastest Theme
...
0
votes
2
answers
535
views
How & where is magento javascript initialized on "DOM ready"?
The docs for initializing JavaScript state:
On DOM ready, the data-mage-init attribute is parsed to extract component names and configuration to be applied to the element.
Where does this "DOM ...
0
votes
1
answer
431
views
can anyone find out the error in this knockout js code
this is phtml file located in Namespace_ModuleName/view/adminhtml/templates/js_time.phtml
<div>
<h4>Current Time is:</h4><span id="time_show" data-bind="text: ...
0
votes
3
answers
2k
views
Override js widget variable using mixin
I'm trying to override a widget variable using mixin , but I get the following error Uncaught TypeError: target.extend is not a function
the original file is
define([
"underscore",
&...
0
votes
1
answer
73
views
Magento 2 - Two scripts have method with same name, how to call one specific of them
Situation
The method "test" does exist two times. If I call it while both scripts are required, then only the last one is getting called e.g. the one from test2.js
app/code/Company/Test/view/...
7
votes
2
answers
11k
views
Uncaught Error: Mismatched anonymous define() module
I'm trying to use jquery in an adminhtml js file...but it seems not to be working and can't get to understand why...any help would be appreciated !
Layout is like
<head>
<script src="...
0
votes
1
answer
436
views
How can I resolve the JavaScript error after upgrade magenta from M 2.4.3 to 2.4.5 in Magento 2??
Here I upgrade Magento from 2.4.3 to 2.4.5 so getting a javascript error can anyone help me how can I resolve this error?
Can not find out what excatly issue
0
votes
1
answer
391
views
Magento 2 Should I use multiple require js inside a phtml file?
I need to use require js to use jquery in my block.
Do I have to declare for each function require JS at each beginning or there is a way to declare it only once?
here is my code, thanks
my html
<...
1
vote
1
answer
197
views
Magento 2: Use of map in RequireJs-config
Is anyone know the use of this 'custom' & when we need to use that?
var config = {
map: {
**'custom':** {
'@@@': '@@@',
'@@@': 'js/@@@'
...