privacy statement. Uncaught ReferenceError: require is not defined at Object.url Electron-React-Typescrypt React-Bootstrap Uncaught ReferenceError: require is not defined ReactJs - Multiple Components - Error: Uncaught ReferenceError: require is not defined These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc. Every day, I develop for a PHP application based on Laravel which works on Nginx and Apache, just fine. please check sample code here if you are using color picker, https://aemlab.blogspot.com/2019/07/aem-rte-custom-plugins-1.html. To solve Uncaught ReferenceError: required is not definedin JavaScript, download the requireJS from its official website, put it on your script folder, and then include it via script tag on your HTML file. If you wish to reuse some code that was written in the traditional CommonJS module format it may be difficult to re-work to the array of dependencies used above, and you may prefer to have direct alignment of dependency name to the local variable used for that dependency. Inside of app.js , you can load any scripts you need to use in your project. Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features. Chrome, Safari, and Firefox are examples of modern browsers that support import/export syntax within a script that uses a type module. Import export not working with React. React - Uncaught ReferenceError: require is not defined; React - Uncaught ReferenceError: require is not defined 1 Answer. }); I have tried that as well, but its not working. You can also use the import statement right in the HTML file like this: If you want to use the require() function in a browser, then you need to add RequireJS to your script. You can call the hello() function anytime after the