Please fix the define functionality for dagre-d3 to with with requireJs.
I see three issues :
Issue 1. When including requirejs library above dagre-d3.js library in the browser like :
Issue 3:
Even in a simple html file, if we include require.js first and then include dagre-d3.js, its blowing up the the browser with the same error : Uncaught Error: Mismatched anonymous define()
We are not having this issue if we load dagre-d3 first and then requireJS. But in my application, requireJS is loaded first and then the following code in dagre-d3 :
typeof define==="function"&&define.amd){define([],f)
is throwing the same error.
For now, i have to add false to the condition to not to execute : define([],f) like
Please fix the define functionality for dagre-d3 to with with requireJs. I see three issues : Issue 1. When including requirejs library above dagre-d3.js library in the browser like :
I am getting following error in console :
require.js:165 Uncaught Error: Mismatched anonymous define() module: function (){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
Issue 2. Not able to use directly with requireJS like 👍
I am getting same above error in console when i try to add dagre-d3 as a dependency like :
Also, tried adding a shim. Its not working with gulp-requirejs. Please take a look at : https://github.com/arun-kahuna/shim-not-working
Issue 3: Even in a simple html file, if we include require.js first and then include dagre-d3.js, its blowing up the the browser with the same error : Uncaught Error: Mismatched anonymous define()
We are not having this issue if we load dagre-d3 first and then requireJS. But in my application, requireJS is loaded first and then the following code in dagre-d3 :
typeof define==="function"&&define.amd){define([],f)
is throwing the same error.
For now, i have to add false to the condition to not to execute : define([],f) like
else if(false && typeof define==="function"&&define.amd){define([],f)}
Then dagre-d3 can load after requirejs library on the same page.