Error "unexpected garbage after module, starting with '}'" when viewing marimo notebook in Firefox 142.0.1 on MacOS #6239
-
I suspect that this is not actually a problem with Marimo so I'm putting it in a discussion rather than a bug, but thus far I can only make it happen when I try to launch Marimo, and I'm having trouble finding any additional information for debugging the problem, so I thought I would check if anyone else here had seen it before. I have been unable to find much reference to it in googling. I have a conda environment in which I am using
![]() I am not sure what might have changed between working with the notebook yesterday and today. I am launching the notebook using: pixi run marimo edit marimo/sec10k-data-review.py Things I've tried so far
pixi run marimo edit test.py
pixi run marimo edit test.py
Is it my Python 🐍 setup?
uv tool install marimo
uvx marimo edit -d --sandbox marimo/sec10k-data-review.py
Is it my Marimo configuration?
Is it my Javascript?
pixi run node -e "console.log('Node.js is working!')"
Can I even run the tutorial?
uvx marimo tutorial intro Can I get more verbose logging / error messages?
pixi run marimo -d edit test.py
Is it the code, or my environment?I asked a co-worker to check out the branch my PR is on and try to edit the notebook, and it worked fine for her! So it seems like it's something about my broader computing environment rather than the code that's checked in. But I'm at a loss to understand the problem. uvx marimo env {
"marimo": "0.15.2",
"editable": false,
"OS": "Darwin",
"OS Version": "24.6.0",
"Processor": "arm",
"Python Version": "3.13.5",
"Binaries": {
"Browser": "--",
"Node": "v24.7.0"
},
"Dependencies": {
"click": "8.2.1",
"docutils": "0.22",
"itsdangerous": "2.2.0",
"jedi": "0.19.2",
"markdown": "3.8.2",
"narwhals": "2.3.0",
"packaging": "25.0",
"psutil": "7.0.0",
"pygments": "2.19.2",
"pymdown-extensions": "10.16.1",
"pyyaml": "6.0.2",
"starlette": "0.47.3",
"tomlkit": "0.13.3",
"typing-extensions": "missing",
"uvicorn": "0.35.0",
"websockets": "15.0.1"
},
"Optional Dependencies": {
"loro": "1.6.0"
},
"Experimental Flags": {}
}
uvx marimo -d tutorial intro
What else can I check?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Oh my gawd. Okay, it looks like this is somehow specific to Firefox (I am running Firefox v142.0.1). I searched for unexpected garbage after module on GitHub and virtually all of the results seemed to be in other codebases that had been forked from Firefox, and this one-line unit test: // |jit-test| error: SyntaxError: unexpected garbage after module
parseModule(("}")); Which seems to be what is somehow generating the error that I'm getting. It appears to refer to this closed 10 year old bug. And if I cut-and-paste the localhost URL for the notebook into Safari, it runs just fine! Unfortunately, even if I restart Firefox in "safe mode" with all extensions and plugins disabled, I still get the same error, so it seems like it's really a Firefox problem. I feel like I haven't updated Firefox in the last couple of days though. The last modified date on the binary is 2025-08-28 and I've definitely been able to run Marimo notebooks more recently than that. So maybe it's not Firefox per-se, but some new interaction between Marimo and Firefox? If I open up the debugging panel in Firefox to see where the error is coming from, I end up in function i(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}var o=new RegExp("^[\\+\\-\\*/&|\\^~<>!@'\\\\]"),c=new RegExp("^[\\(\\[\\{\\},:=;\\.]"),m=new RegExp("^((==)|(~=)|(<=)|(>=)|(<<)|(>>)|(\\.[\\+\\-\\*/\\^\\\\]))"),s=new RegExp("^((!=)|(\\+=)|(\\-=)|(\\*=)|(/=)|(&=)|(\\|=)|(\\^=))"),u=new RegExp("^((>>=)|(<<=))"),l=new RegExp("^[\\]\\)]"),f=new RegExp("^[_A-Za-z\xA1-\uFFFF][_A-Za-z0-9\xA1-\uFFFF]*"),h=i(["error","eval","function","abs","acos","atan","asin","cos","cosh","exp","log","prod","sum","log10","max","min","sign","sin","sinh","sqrt","tan","reshape","break","zeros","default","margin","round","ones","rand","syn","ceil","floor","size","clear","zeros","eye","mean","std","cov","det","eig","inv","norm","rank","trace","expm","logm","sqrtm","linspace","plot","title","xlabel","ylabel","legend","text","grid","meshgrid","mesh","num2str","fft","ifft","arrayfun","cellfun","input","fliplr","flipud","ismember"]),d=i(["return","case","switch","else","elseif","end","endif","endfunction","if","otherwise","do","for","while","try","catch","classdef","properties","events","methods","global","persistent","endfor","endwhile","printf","sprintf","disp","until","continue","pkg"]);function a(e,n){return e.sol()||e.peek()!=="'"?(n.tokenize=r,r(e,n)):(e.next(),n.tokenize=r,"operator")}function g(e,n){return e.match(/^.*%}/)?(n.tokenize=r,"comment"):(e.skipToEnd(),"comment")}function r(e,n){if(e.eatSpace())return null;if(e.match("%{"))return n.tokenize=g,e.skipToEnd(),"comment";if(e.match(/^[%#]/))return e.skipToEnd(),"comment";if(e.match(/^[0-9\.+-]/,!1)){if(e.match(/^[+-]?0x[0-9a-fA-F]+[ij]?/))return e.tokenize=r,"number";if(e.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?[ij]?/)||e.match(/^[+-]?\d+([EeDd][+-]?\d+)?[ij]?/))return"number"}if(e.match(i(["nan","NaN","inf","Inf"])))return"number";var t=e.match(/^"(?:[^"]|"")*("|$)/)||e.match(/^'(?:[^']|'')*('|$)/);return t?t[1]?"string":"error":e.match(d)?"keyword":e.match(h)?"builtin":e.match(f)?"variable":e.match(o)||e.match(m)?"operator":e.match(c)||e.match(s)||e.match(u)?null:e.match(l)?(n.tokenize=a,null):(e.next(),"error")}const k={name:"octave",startState:function(){return{tokenize:r}},token:function(e,n){var t=n.tokenize(e,n);return t!=="number"&&t!=="variable"||(n.tokenize=a),t},languageData:{commentTokens:{line:"%"}}};export{k as octave};
ave}; But if I actually edit the corresponding file down in If I do a hard reload (cmd-shift-R) to re-pull everything from the server again, I get an error about there not being a WASM compiler available. At least it's something different! Restarting the marimo server at the command line and loading the localhost page again, it works! So it seems like somehow that garbled javascript got cached by Firefox and it just kept getting reused, no matter what I did with the environment I was running Marimo from. |
Beta Was this translation helpful? Give feedback.
Oh my gawd. Okay, it looks like this is somehow specific to Firefox (I am running Firefox v142.0.1).
I searched for unexpected garbage after module on GitHub and virtually all of the results seemed to be in other codebases that had been forked from Firefox, and this one-line unit test:
Which seems to be what is somehow generating the error that I'm getting. It appears to refer to this closed 10 year old bug.
And if I cut-and-paste the localhost URL for the notebook into Safari, it runs just fine!
Unfortunately, even if I restart Firefox in "safe mode" with all extensions and plugins disabled, I still get…