Uncaught error: Mismatched anonymous define() module
Skycocoo opened this issue · 1 comments
Skycocoo commented
I followed the steps in the migration guide to get my access token. However, I have a hard time powering up the instafeed.min.js: I faced an uncaught error as shown below. I have updated the js files for require and jquery to their latest cdns, so I'm not sure what would be the issue here.
I really appreciate any help you can provide
page:
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="[getting the access token]"></script>
<script src="[path to instafeed.min.js]"></script>
error:
Uncaught Error: Mismatched anonymous define() module: function () { "use strict"; function e(e, t) { if (!e) throw new Error(t) } function t(t) { e(!t || "object" == typeof t, "options must be an object, got " + t + " (" + typeof t + ")"); var o = { accessToken: null, accessTokenTimeout: 1e4, after: null, apiTimeout: 1e4, apiLimit: null, before: null, debug: !1, error: null, filter: null, limit: null, mock: !1, render: null, sort: null, success: null, target: "instafeed", template: '<a href="{{link}}"><img title="{{caption}}" src="{{image}}" /></a>', templateBoundaries: ["{{", "}}"], transform: null }; if (t) for (var n in o) "undefined" != typeof t[n] && (o[n] = t[n]); e("string" == typeof o.target || "object" == typeof o.target, "target must be a string or DOM node, got " + o.target + " (" + typeof o.target + ")"), e("string" == typeof o.accessToken || "function" == typeof o.accessToken, "accessToken must be a string or function, got " + o.accessToken + " (" + typeof o.accessToken + ")"), e("number" == typeof o.accessTokenTimeout, "accessTokenTimeout must be a number, got " + o.accessTokenTimeout + " (" + typeof o.accessTokenTimeout + ")"), e("number" == typeof o.apiTimeout, "apiTimeout must be a number, got " + o.apiTimeout + " (" + typeof o.apiTimeout + ")"), e("boolean" == typeof o.debug, "debug must be true or false, got " + o.debug + " (" + typeof o.debug + ")"), e("boolean" == typeof o.mock, "mock must be true or false, got " + o.mock + " (" + typeof o.mock + ")"), e("object" == typeof o.templateBoundaries && 2 === o.templateBoundaries.length && "string" == typeof o.templateBoundaries[0] && "string" == typeof o.templateBoundaries[1], "templateBoundaries must be an array of 2 strings, got " + o.templateBoundaries + " (" + typeof o.templateBoundaries + ")"), e(!o.template || "string" == typeof o.template, "template must null or string, got " + o.template + " (" + typeof o.template + ")"), e(!o.error || "function" == typeof o.error, "error must be null or function, got " + o.error + " (" + typeof o.error + ")"), e(!o.before || "function" == typeof o.before, "before must be null or function, got " + o.before + " (" + typeof o.before + ")"), e(!o.after || "function" == typeof o.after, "after must be null or function, got " + o.after + " (" + typeof o.after + ")"), e(!o.success || "function" == typeof o.success, "success must be null or function, got " + o.success + " (" + typeof o.success + ")"), e(!o.filter || "function" == typeof o.filter, "filter must be null or function, got " + o.filter + " (" + typeof o.filter + ")"), e(!o.transform || "function" == typeof o.transform, "transform must be null or function, got " + o.transform + " (" + typeof o.transform + ")"), e(!o.sort || "function" == typeof o.sort, "sort must be null or function, got " + o.sort + " (" + typeof o.sort + ")"), e(!o.render || "function" == typeof o.render, "render must be null or function, got " + o.render + " (" + typeof o.render + ")"), e(!o.limit || "number" == typeof o.limit, "limit must be null or number, got " + o.limit + " (" + typeof o.limit + ")"), e(!o.apiLimit || "number" == typeof o.apiLimit, "apiLimit must null or number, got " + o.apiLimit + " (" + typeof o.apiLimit + ")"), this._state = { running: !1, node: null, token: null, paging: null, pool: [] }, this._options = o } return t.prototype.run = function () { var e = this; return this._debug("run", "options", this._options), this._debug("run", "state", this._state), this._state.running ? (this._debug("run", "already running, skipping"), !1) : (this._start(), this._debug("run", "getting dom node"), "string" == typeof this._options.target ? this._state.node = document.getElementById(this._options.target) : this._state.node = this._options.target, this._state.node ? (this._debug("run", "got dom node", this._state.node), this._debug("run", "getting access token"), this._getAccessToken(function (t, o) { if (t) return e._debug("onTokenReceived", "error", t), void e._fail(new Error("error getting access token: " + t.message)); e._debug("onTokenReceived", "got token", o), e._state.token = o, e._showNext(function (t) { if (t) return e._debug("onNextShown", "error", t), void e._fail(t); e._finish() }) }), !0) : (this._fail(new Error("no element found with ID " + this._options.target)), !1)) }, t.prototype.hasNext = function () { var e = this._state.paging, t = this._state.pool; return this._debug("hasNext", "paging", e), this._debug("hasNext", "pool", t.length, t), t.length > 0 || e && "string" == typeof e.next }, t.prototype.next = function () { var e = this; return e.hasNext() ? e._state.running ? (e._debug("next", "already running, skipping"), !1) : (e._start(), void e._showNext(function (t) { if (t) return e._debug("onNextShown", "error", t), void e._fail(t); e._finish() })) : (e._debug("next", "hasNext is false, skipping"), !1) }, t.prototype._showNext = function (e) { var t = this, o = null, n = null, i = "number" == typeof this._options.limit; if (t._debug("showNext", "pool", t.https://requirejs.org/docs/errors.html#mismatch
at makeError (require.min.js:1)
at T (require.min.js:1)
at require.min.js:1
makeError @ require.min.js:1
T @ require.min.js:1
(anonymous) @ require.min.js:1
setTimeout (async)
req.nextTick @ require.min.js:1
s @ require.min.js:1
requirejs @ require.min.js:1
(anonymous) @ require.min.js:1
(anonymous) @ require.min.js:1
Skycocoo commented
It works after I removed the requirejs link