7,700 questions
0 votes
1 answer
82 views
Require.js fails to load data-main script (looks into wrong place)
Requirejs library fails to load script defined in data-main attribute for require.js script. According to browser output it looks into wrong place. Can't sort it out why and how to fix it. Created ...
1 vote
2 answers
98 views
Webpack automatically resolve default import
I am attempting to migrate our single-page application from RequireJS to Webpack. As part of this transition, I am gradually rewriting our hundreds of modules from ASM define() syntax to modern ESM ...
0 votes
0 answers
105 views
Using Javascript import to replace a require() call when importing from a Typescript module
I am maintaining some Javascript code in a React application that imports from a Typescript library using the require function. The import statement looks like this: const utc = require('dayjs/plugin/...
-1 votes
2 answers
149 views
Unable to reduce React app build bundle size
This line of code is expensive to run: require(`./path/to/large_file`) Without it, the React app build bundle resulted in 36 MB. With it, it resulted in 92 MB. The above line of code is run during ...
1 vote
0 answers
74 views
Ag-Charts 10.2 is Not Loading in Require.JS App
I have a require.js app and I am adding enterprise edition of Ag-Charts in it. I can successfully add 9.0 version of Ag-Charts but when I try to add 10.2 version, it's not loading somehow. Can someone ...
0 votes
0 answers
76 views
require js is not supporting optional chaining at the bundling process (grunt bundler)
Running "requirejs:desktop" (requirejs) task Error: Parse error using esprima for file: C:/projects/GitProjects/vendorgames-sonarqube/ndcasinocommon/base_common/fcga mes/vendorgames/...
1 vote
0 answers
59 views
Migrate a large project using Require.js
I work on a fairly large Javascript project (~863 files), where all the code is distributed in a modular way, being practically one file per class (object-oriented). Some things are loaded on the fly, ...
-2 votes
1 answer
1k views
How do I use both `require` and `import` in a Node.js script?
having a node js basic project setup with package.json , install a package and try to use both require and import statment in the same file; to do that here is what did so far but not working. First ...
-1 votes
2 answers
320 views
Undefined error while loading Survey-creator-core using RequireJS
I am using requireJS in my project and want to load survey-core and survey-creator-core. survey-creator-core has a dependency on survey-core when i checked the js file of survey-creator-core. I got ...
-1 votes
2 answers
180 views
Require JS with jest to mock function in same module
I am working on a NetSuite suitescript customization and would like to write the test with Jest. Since suitescript run with Require JS, I would like to know how to correctly mock the function as I ...
1 vote
0 answers
374 views
RequireJS Error "No define call for core/first" on Moodle Installation via Docker
I'm working on a project that involves deploying Moodle using Docker. The setup includes two Docker containers: one for the database (MariaDB) and one for Moodle (i also have a container for django, ...
0 votes
1 answer
526 views
Error: Cannot find module '../controllers/userController' in Express.js Application
I am working on a full-stack project using Express.js for the backend and MongoDB for the database. I am encountering an error when trying to start my server. The error message is as follows: Error: ...
0 votes
2 answers
1k views
Node.js import results in ERR_MODULE_NOT_FOUND
Here is how I built and installed node.js(version: 20.11): ./configure --prefix=/home/tester/node make -j8 make install Here is how I set the environment: export PATH=/home/tester/node/bin:$PATH ...
0 votes
0 answers
55 views
requireJS element is not a function
simple example RequireJs I get Error : Uncaught TypeError: hi is not a function say.js define(function () { var say={}; say.hi=function hi(){ console.log('hi'); } return say; }); ...
0 votes
0 answers
1k views
Webpack warning "the request of a dependency is an expression" goes away using template strings instead of variables. How?
I had a webpack warning in my nextjs dev server saying Critical dep: the request of a dependency is an expression This was because I imported some modules using variables, but the warning got away ...