Skip to content Skip to sidebar Skip to footer

Requirejs Anonymous Dependency Not Defined

I have a problem with requirejs and a dependency being undefined. My setup is the following: var lib = function (){...}; define(function() { return lib; }); And the modules a

Solution 1:

So the actual problem was that everything was within an IIFE. This leads to define not being available, which leads to the If clause resolving in the else part.

Window.define is available however, so passing this to the IIFE solves my issue.

Post a Comment for "Requirejs Anonymous Dependency Not Defined"