3

I'm getting an error in the console and it says:

Uncaught ReferenceError: config is not defined.

The file it relates to is requirejs-config.js:1149 but I have no idea what this relates to or how to fix it. Any ideas?

The code in question is:

})(require);
require.config(config);
})();
  • You post anly part of code. It's not valid java script code. – KAndy Aug 9 '16 at 16:24
6

You probably have a requirejs-config.js file somewhere in your codebase that is empty. Magento includes every requirejs-config.js file it finds, but it does expect it to contain a config object.

In terminal, in your Magento root, run;

find . -type f -iname requirejs-config.js | xargs ls -1lathr

Look for files that are 0 bytes. Either remove those files or place an empty config object in it;

var config = {};

That should fix it.

  • I commented the complete content of a requirejs-config.js file. Has same effect as an empty file... Your hint helped me out, thx! – DaFunkyAlex Jan 12 '18 at 15:33
  • Right on the money! – Shawn Abramson Jul 18 '19 at 13:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.