Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Mismatched anonymous define() module' on debug Web since the new 3.22.1 Flutter version #149076

Closed
flrnsbt opened this issue May 25, 2024 · 9 comments
Labels
in triage Presently being triaged by the triage team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds

Comments

@flrnsbt
Copy link

flrnsbt commented May 25, 2024

Steps to reproduce

flutter run -d chrome --debug

Expected results

Web app to launches.

Actual results

App never starts.

Code sample

Code sample
flutter run -d chrome --debug

Logs

Logs
require.js:143 Uncaught Error: Mismatched anonymous define() module: function(){return function t(e,A,i){function r(a,o){if(!A[a]){if(!e[a]){var s="function"==typeof require&&require;if(!o&&s)return s(a,!0);if(n)return n(a,!0);var h=new Error("Cannot find module '"+a+"'");throw h.code="MODULE_NOT_FOUND",h}var u=A[a]={exports:{}};e[a][0].call(u.exports,(function(t){return r(e[a][1][t]||t)}),u,u.exports,t,e,A,i)}return A[a].exports}for(var n="function"==typeof require&&require,a=0;a<i.length;a++)r(i[a]);return r}({1:[function(t,e,A){"use strict";var i=t("multimath"),r=t("./mm_unsharp_mask"),n=t("./mm_resize");function a(t){var e=t||[],A={js:e.indexOf("js")>=0,wasm:e.indexOf("wasm")>=0};i.call(this,A),this.features={js:A.js,wasm:A.wasm&&this.has_wasm()},this.use(r),this.use(n)}a.prototype=Object.create(i.prototype),a.prototype.constructor=a,a.prototype.resizeAndUnsharp=function(t,e){var A=this.resize(t,e);return t.unsharpAmount&&this.unsharp_mask(A,t.toWidth,t.toHeight,t.unsharpAmount,t.unsharpRadius,t.unsharpThreshold),A},e.exports=a},{"./mm_resize":4,"./mm_unsharp_mask":9,multimath:19}],2:[function(t,e,A){"use strict";function i(t){return t<0?0:t>255?255:t}function r(t){return t>=0?t:0}e.exports={convolveHor:function(t,e,A,i,n,a){var o,s,h,u,c,f,g,l,I,d,B,m=0,Q=0;for(I=0;I<i;I++){for(c=0,d=0;d<n;d++){for(f=a[c++],g=a[c++],l=m+4*f|0,o=s=h=u=0;g>0;g--)u=u+(B=a[c++])*t[l+3]|0,h=h+B*t[l+2]|0,s=s+B*t[l+1]|0,o=o+B*t[l]|0,l=l+4|0;e[Q+3]=r(u>>7),e[Q+2]=r(h>>7),e[Q+1]=r(s>>7),e[Q]=r(o>>7),Q=Q+4*i|0}Q=4*(I+1)|0,m=(I+1)*A*4|0}},convolveVert:function(t,e,A,r,n,a){var o,s,h,u,c,f,g,l,I,d,B,m=0,Q=0;for(I=0;I<r;I++){for(c=0,d=0;d<n;d++){for(f=a[c++],g=a[c++],l=m+4*f|0,o=s=h=u=0;g>0;g--)u=u+(B=a[c++])*t[l+3]|0,h=h+B*t[l+2]|0,s=s+B*t[l+1]|0,o=o+B*t[l]|0,l=l+4|0;o>>=7,s>>=7,h>>=7,u>>=7,e[Q+3]=i(u+8192>>14),e[Q+2]=i(h+8192>>14),e[Q+1]=i(s+8192>>14),e[Q]=i(o+8192>>14),Q=Q+4*r|0}Q=4*(I+1)|0,m=(I+1)*A*4|0}},convolveHorWithPre:function(t,e,A,i,n,a){var o,s,h,u,c,f,g,l,I,d,B,m,Q=0,p=0;for(d=0;d<i;d++){for(f=0,B=0;B<n;B++){for(g=a[f++],l=a[f++],I=Q+4*g|0,o=s=h=u=0;l>0;l--)u=u+(m=a[f++])*(c=t[I+3])|0,h=h+m*t[I+2]*c|0,s=s+m*t[I+1]*c|0,o=o+m*t[I]*c|0,I=I+4|0;h=h/255|0,s=s/255|0,o=o/255|0,e[p+3]=r(u>>7),e[p+2]=r(h>>7),e[p+1]=r(s>>7),e[p]=r(o>>7),p=p+4*i|0}p=4*(d+1)|0,Q=(d+1)*A*4|0}},convolveVertWithPre:function(t,e,A,r,n,a){var o,s,h,u,c,f,g,l,I,d,B,m=0,Q=0;for(I=0;I<r;I++){for(c=0,d=0;d<n;d++){for(f=a[c++],g=a[c++],l=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IAEgCEECcmogDUH/AW1BB3UiB0EAIAdBAEobOwEAIAEgCEEEcmogDEH/AW1BB3UiB0EAIAdBAEobOwEAIAEgCEEGcmogCUEAIAlBAEobOwEAIAogFWohCiATQQFqIhMgBEcNAAsgC0EBaiILIAJsIRIgC0ECdCEKIAMgC0cNAAsLC4IEAQ9/AkAgA0UNACAERQ0AIAJBAnQhFANAIAshDEEAIRJBACEHA0AgB0ECaiEKAn8gB0EBdCAFaiICLgECIhNFBEBBACEIQQAhCUEAIQYgCiEHQQAMAQsgAi4BAEECdCARaiEJQQAhByATIQJBACENIAohBkEAIQ5BACEPA0AgBSAGQQF0ai4BACIIIAAgCUEBdCIQai8BAGwgB2ohByAAIBBBBnJqLwE/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
"use strict";var i=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function a(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},A=0;A<10;A++)e["_"+String.fromCharCode(A)]=A;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach((function(t){i[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var A,o,s=a(t),h=1;h<arguments.length;h++){for(var u in A=Object(arguments[h]))r.call(A,u)&&(s[u]=A[u]);if(i){o=i(A);for(var c=0;c<o.length;c++)n.call(A,o[c])&&(s[o[c]]=A[o[c]])}}return s}},{}],23:[function(t,e,A){var i=arguments[3],r=arguments[4],n=arguments[5],a=JSON.stringify;e.exports=function(t,e){for(var A,o=Object.keys(n),s=0,h=o.length;s<h;s++){var u=o[s],c=n[u].exports;if(c===t||c&&c.default===t){A=u;break}}if(!A){A=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var f={};for(s=0,h=o.length;s<h;s++){f[u=o[s]]=u}r[A]=["function(require,module,exports){"+t+"(self); }",f]}var g=Math.floor(Math.pow(16,8)*Math.random()).toString(16),l={};l[A]=A,r[g]=["function(require,module,exports){var f = require("+a(A)+");(f.default ? f.default : f)(self);}",l];var I={};!function t(e){for(var A in I[e]=!0,r[e][1]){var i=r[e][1][A];I[i]||t(i)}}(g);var d="("+i+")({"+Object.keys(I).map((function(t){return a(t)+":["+r[t][0]+","+a(r[t][1])+"]"})).join(",")+"},{},["+a(g)+"])",B=window.URL||window.webkitURL||window.mozURL||window.msURL,m=new Blob([d],{type:"text/javascript"});if(e&&e.bare)return m;var Q=B.createObjectURL(m),p=new Worker(Q);return p.objectURL=Q,p}},{}],"/index.js":[function(t,e,A){"use strict";function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var A=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==A)return;var i,r,n=[],a=!0,o=!1;try{for(A=A.call(t);!(a=(i=A.next()).done)&&(n.push(i.value),!e||n.length!==e);a=!0);}catch(t){o=!0,r=t}finally{try{a||null==A.return||A.return()}finally{if(o)throw r}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return r(t,e);var A=Object.prototype.toString.call(t).slice(8,-1);"Object"===A&&t.constructor&&(A=t.constructor.name);if("Map"===A||"Set"===A)return Array.from(t);if("Arguments"===A||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A))return r(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var A=0,i=new Array(e);A<e;A++)i[A]=t[A];return i}var n=t("object-assign"),a=t("webworkify"),o=t("./lib/mathlib"),s=t("./lib/pool"),h=t("./lib/utils"),u=t("./lib/worker"),c=t("./lib/stepper"),f=t("./lib/tiler"),g=t("./lib/mm_resize/resize_filter_info"),l={},I=!1;try{"undefined"!=typeof navigator&&navigator.userAgent&&(I=navigator.userAgent.indexOf("Safari")>=0)}catch(t){}var d=1;"undefined"!=typeof navigator&&(d=Math.min(navigator.hardwareConcurrency||1,4));var B={tile:1024,concurrency:d,features:["js","wasm","ww"],idle:2e3,createCanvas:function(t,e){var A=document.createElement("canvas");return A.width=t,A.height=e,A}},m={filter:"mks2013",unsharpAmount:0,unsharpRadius:0,unsharpThreshold:0},Q=!1,p=!1,E=!1,w=!1,C=!1;function _(){return{value:a(u),destroy:function(){if(this.value.terminate(),"undefined"!=typeof window){var t=window.URL||window.webkitURL||window.mozURL||window.msURL;t&&t.revokeObjectURL&&this.value.objectURL&&t.revokeObjectURL(this.value.objectURL)}}}}function b(t){if(!(this instanceof b))return new b(t);this.options=n({},B,t||{});var e="lk_".concat(this.options.concurrency);this.__limit=l[e]||h.limiter(this.options.concurrency),l[e]||(l[e]=this.__limit),this.features={js:!1,wasm:!1,cib:!1,ww:!1},this.__workersPool=null,this.__requested_features=[],this.__mathlib=null}b.prototype.init=function(){var e=this;if(this.__initPromise)return this.__initPromise;if("undefined"!=typeof ImageData&&"undefined"!=typeof Uint8ClampedArray)try{new ImageData(new Uint8ClampedArray(400),10,10),Q=!0}catch(t){}"undefined"!=typeof ImageBitmap&&(ImageBitmap.prototype&&ImageBitmap.prototype.close?p=!0:this.debug("ImageBitmap does not support .close(), disabled"));var A=this.options.features.slice();if(A.indexOf("all")>=0&&(A=["cib","wasm","js","ww"]),this.__requested_features=A,this.__mathlib=new o(A),A.indexOf("ww")>=0&&"undefined"!=typeof window&&"Worker"in window)try{t("webworkify")((function(){})).terminate(),this.features.ww=!0;var i="wp_".concat(JSON.stringify(this.options));l[i]?this.__workersPool=l[i]:(this.__workersPool=new s(_,this.options.idle),l[i]=this.__workersPool)}catch(t){}var http://requirejs.org/docs/errors.html#mismatch
    at makeError (require.js:168:17)
    at intakeDefines (require.js:1254:36)
    at Object.localRequire [as require] (require.js:1446:21)
    at requirejs (require.js:1797:24)
    at req.config (require.js:1805:16)
    at main_module.bootstrap.js:3:9

Flutter Doctor output

Doctor output
flrnsbt@flrnsbt flutter % flutter doctor -v
[✓] Flutter (Channel stable, 3.22.1, on macOS 14.4.1 23E224 darwin-arm64, locale en-TH)
    • Flutter version 3.22.1 on channel stable at /Library/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision a14f74ff3a (3 days ago), 2024-05-22 11:08:21 -0500
    • Engine revision 55eae6864b
    • Dart version 3.4.1
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0-rc3)
    • Android SDK at /Users/flrnsbt/Library/Android/sdk/
    • Platform android-34, build-tools 34.0.0-rc3
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    ✗ Unable to get list of installed Simulator runtimes.
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)

[✓] VS Code (version 1.89.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.44.0

[✓] Connected device (3 available)
    • macOS (desktop)                 • macos                 • darwin-arm64   • macOS 14.4.1 23E224 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin         • macOS 14.4.1 23E224 darwin-arm64
    • Chrome (web)                    • chrome                • web-javascript • Google Chrome 125.0.6422.77

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.
@darshankawar darshankawar added the in triage Presently being triaged by the triage team label May 27, 2024
@darshankawar
Copy link
Member

@flrnsbt
I can't replicate the reported error by running an existing app using latest stable version. Can you provide us a runnable reproducible code sample and index.html which replicates the error ?

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 27, 2024
@mcagrigoktas
Copy link

The same error occurs in my project as well. This error does not appear in release mode. Additionally, it only occurs the first time it runs. When I press the refresh button in the browser, it does not give this error.

@flrnsbt
Copy link
Author

flrnsbt commented May 28, 2024

Unfortunately I'm unable to share any code of this application.
This is only happening on macOS chrome for me. The exact same project on Ubuntu never had this issue.
Tried reinstalling the flutter sdk, or tried the master channel, but that didn't solve the issue.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 28, 2024
@darshankawar
Copy link
Member

@flrnsbt We will atleast require exact steps to replicate or a reproducible code sample. Or you can try by narrowing down the issue to the minimal by removing external dependencies and see if you still get same error with barebone Flutter project or not.

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 28, 2024
Copy link

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now.
If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones.
Thanks for your contribution.

@millerovv
Copy link

@flrnsbt did you manage to overcome this? I now experience same issue on my Mac Chrome after updating to 3.22.2.

@phamnhuvu-dev
Copy link

@millerovv select Empty cache and Hard reload on the browser

@phamnhuvu-dev
Copy link

The same error occurs in my project as well. This error does not appear in release mode. Additionally, it only occurs the first time it runs. When I press the refresh button in the browser, it does not give this error.

I have the same experience

@quannguyen42
Copy link

Just curious if anyone is working on this. Really appreciate any info on how to troubleshoot this further.

It's ONLY a problem with the debug mode. Perhaps it has to do with some packages used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in triage Presently being triaged by the triage team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds
Projects
None yet
Development

No branches or pull requests

6 participants