MMDC not found in mermaid.cli - mermaid

I tried to use gatsby-remark-draw to render mermaid diagrams which includes installing mermaid and mermaid.cli. However, the diagram becomes code blocks instead, even though I followed the instruction of putting this plugin before the gatsby-remark-prismjs in the config. And I kept on getting this error:
Unhandled exception in rendering: Error: Unable to render graph language with mermaid:
Error: not found: mmdc

Related

Lighthouse Error: LHR failed to render in Angular SSR

I am trying to run a lighthouse performance audit on an Angular SSR yet it returns an empty page. No error messages or anything.
However, if I run it on https://pagespeed.web.dev/ it says Core Web Vitals Assessment: Failed and Error: LHR failed to render. But it does show me the data from the previews 28 days.
If I run the lighthouse CLI I am able to get the JSON report but it will also not render an HTML version and does not seem to show any errors.
"lighthouse https://daomaker.com --output=json --output-path=./report.json --save-assets --only-categories=performance"
It returns 3 files, report-0.devtoolslog.json report-0.trace.json report.json
If I open the empty HTML tab and look at the HTML I get this console error:
compiled-reportrenderer.js:92 Uncaught TypeError: Cannot read properties of null (reading 'toString')
at Function.render (compiled-reportrenderer.js:92:2125)
at z.renderNode (compiled-reportrenderer.js:108:6424)
at z._renderTableValue (compiled-reportrenderer.js:108:2467)
at z._renderTableRow (compiled-reportrenderer.js:108:4484)
at z._renderTableRowsFromItem (compiled-reportrenderer.js:108:4755)
at z._renderTable (compiled-reportrenderer.js:108:5510)
at z.render (compiled-reportrenderer.js:108:266)
at F.populateAuditValues (compiled-reportrenderer.js:66:1478)
at F.renderAudit (compiled-reportrenderer.js:66:357)
at compiled-reportrenderer.js:129:4656
Which seems to relate to this line of code:
function A(e,t,n){return e<t?t:e>n?n:e}class C{static getScreenshotPositions(e,t,n){const r={x:(i=e).left+i.width/2,y:i.top+i.height/2};var i;const o=A(r.x-t.width/2,0,n.width-t.width),a=A(r.y-t.height/2,0,n.height-t.height);return{screenshot:{left:o,top:a},clip:{left:e.left-o,top:e.top-a}}}static renderClipPathInScreenshot(e,t,n,r,i){const o=e.find("clipPath",t),a=`clip-${l.getUniqueSuffix()}`;o.id=a,t.style.clipPath=`url(#${a})`;const s=n.top/i.height,c=s+r.height/i.height,d=n.left/i.width,h=d+r.width/i.width,p=[`0,0 1,0 1,${s} 0,${s}`,`0,${c} 1,${c} 1,1 0,1`,`0,${s} ${d},${s} ${d},${c} 0,${c}`,`${h},${s} 1,${s} 1,${c} ${h},${c}`];for(const t of p){const n=e.createElementNS("http://www.w3.org/2000/svg","polygon");n.setAttribute("points",t),o.append(n)}}static installFullPageScreenshot(e,t){e.style.setProperty("--element-screenshot-url",`url(${t.data})`)}static installOverlayFeature(e){const{dom:t,reportEl:n,overlayContainerEl:r,fullPageScreenshot:i}=e,o="lh-screenshot-overlay--enabled";n.classList.contains(o)||(n.classList.add(o),n.addEventListener("click",(e=>{const n=e.target;if(!n)return;const o=n.closest(".lh-node > .lh-element-screenshot");if(!o)return;const a=t.createElement("div","lh-element-screenshot__overlay");r.append(a);const l={width:.95*a.clientWidth,height:.8*a.clientHeight},s={width:Number(o.dataset.rectWidth),height:Number(o.dataset.rectHeight),left:Number(o.dataset.rectLeft),right:Number(o.dataset.rectLeft)+Number(o.dataset.rectWidth),top:Number(o.dataset.rectTop),bottom:Number(o.dataset.rectTop)+Number(o.dataset.rectHeight)},c=C.render(t,i.screenshot,s,l);c?(a.appendChild(c),a.addEventListener("click",(()=>a.remove()))):a.remove()})))}static _computeZoomFactor(e,t){const n={x:t.width/e.width,y:t.height/e.height},r=.75*Math.min(n.x,n.y);return Math.min(1,r)}static render(e,t,n,r){if(!function(e,t){return t.left<=e.width&&0<=t.right&&t.top<=e.height&&0<=t.bottom}(t,n))return null;const i=e.createComponent("elementScreenshot"),o=e.find("div.lh-element-screenshot",i);o.dataset.rectWidth=n.width.toString(),o.dataset.rectHeight=n.height.toString(),o.dataset.rectLeft=n.left.toString(),o.dataset.rectTop=n.top.toString();const a=this._computeZoomFactor(n,r),l={width:r.width/a,height:r.height/a};l.width=Math.min(t.width,l.width);const s=l.width*a,c=l.height*a,d=C.getScreenshotPositions(n,l,{width:t.width,height:t.height});e.find("div.lh-element-screenshot__content",o).style.top=`-${c}px`;const h=e.find("div.lh-element-screenshot__image",o);h.style.width=s+"px",h.style.height=c+"px",h.style.backgroundPositionY=-d.screenshot.top*a+"px",h.style.backgroundPositionX=-d.screenshot.left*a+"px",h.style.backgroundSize=`${t.width*a}px ${t.height*a}px`;const p=e.find("div.lh-element-screenshot__element-marker",o);p.style.width=n.width*a+"px",p.style.height=n.height*a+"px",p.style.left=d.clip.left*a+"px",p.style.top=d.clip.top*a+"px";const u=e.find("div.lh-element-screenshot__mask",o);return u.style.width=s+"px",u.style.height=c+"px",C.renderClipPathInScreenshot(e,u,d.clip,n,l),o}}
Meaning is probably related to the screenshots.
The bug persist even if I add --screenEmulation.disabled --throttling-method=provided --no-emulatedUserAgent
How do I find the bug stopping the lighthouse from returning an HTML report?

ParDo did not have a ParDoPayload

I've written a Beam pipeline in Go that runs successfully on my local machine, but when I add --runner=dataflow to run it on Google Cloud Dataflow I get a vague error when it's setting up that a ParDo is missing a ParDoPayload. The stacktrace is entirely Java, so I'm not sure how to translate this back into my Go code to figure out what I'm missing.
I've gone through and used beam.RegisterFunction() for all of my functions that emit and also used beam.RegisterType() for the top-level struct I'm passing around.
Any ideas how this error connects to the code I've written / how I can debug?
java.lang.RuntimeException: ParDo did not have a ParDoPayload
at org.apache.beam.runners.dataflow.worker.graph.RegisterNodeFunction.apply(RegisterNodeFunction.java:327)
at org.apache.beam.runners.dataflow.worker.graph.RegisterNodeFunction.apply(RegisterNodeFunction.java:97)
at java.util.function.Function.lambda$andThen$1(Function.java:88)
at org.apache.beam.runners.dataflow.worker.graph.CreateRegisterFnOperationFunction.apply(CreateRegisterFnOperationFunction.java:207)
at org.apache.beam.runners.dataflow.worker.graph.CreateRegisterFnOperationFunction.apply(CreateRegisterFnOperationFunction.java:74)
at java.util.function.Function.lambda$andThen$1(Function.java:88)
at java.util.function.Function.lambda$andThen$1(Function.java:88)
at org.apache.beam.runners.dataflow.worker.BatchDataflowWorker.doWork(BatchDataflowWorker.java:346)
at org.apache.beam.runners.dataflow.worker.BatchDataflowWorker.getAndPerformWork(BatchDataflowWorker.java:305)
at org.apache.beam.runners.dataflow.worker.DataflowRunnerHarness.start(DataflowRunnerHarness.java:195)
at org.apache.beam.runners.dataflow.worker.DataflowRunnerHarness.main(DataflowRunnerHarness.java:123)
Caused by: org.apache.beam.vendor.grpc.v1p21p0.com.google.protobuf.InvalidProtocolBufferException: Protocol message had invalid UTF-8.
at org.apache.beam.vendor.grpc.v1p21p0.com.google.protobuf.InvalidProtocolBufferException.invalidUtf8(InvalidProtocolBufferException.java:141)
at org.apache.beam.vendor.grpc.v1p21p0.com.google.protobuf.Utf8$DecodeUtil.handleTwoBytes(Utf8.java:1909)
at org.apache.beam.vendor.grpc.v1p21p0.com.google.protobuf.Utf8$DecodeUtil.access$700(Utf8.java:1883)
at org.apache.beam.vendor.grpc.v1p21p0.com.google.protobuf.Utf8$UnsafeProcessor.decodeUtf8(Utf8.java:1411)
at org.apache.beam.vendor.grpc.v1p21p0.com.google.protobuf.Utf8.decodeUtf8(Utf8.java:340)
at org.apache.beam.vendor.grpc.v1p21p0.com.google.protobuf.CodedInputStream$ArrayDecoder.readStringRequireUtf8(CodedInputStream.java:804)
at org.apache.beam.model.pipeline.v1.RunnerApi$FunctionSpec.<init>(RunnerApi.java:55936)
at org.apache.beam.model.pipeline.v1.RunnerApi$FunctionSpec.<init>(RunnerApi.java:55897)
at org.apache.beam.model.pipeline.v1.RunnerApi$FunctionSpec$1.parsePartialFrom(RunnerApi.java:56565)
at org.apache.beam.model.pipeline.v1.RunnerApi$FunctionSpec$1.parsePartialFrom(RunnerApi.java:56559)
at org.apache.beam.vendor.grpc.v1p21p0.com.google.protobuf.CodedInputStream$ArrayDecoder.readMessage(CodedInputStream.java:883)
at org.apache.beam.model.pipeline.v1.RunnerApi$ParDoPayload.<init>(RunnerApi.java:10363)
at org.apache.beam.model.pipeline.v1.RunnerApi$ParDoPayload.<init>(RunnerApi.java:10320)
at org.apache.beam.model.pipeline.v1.RunnerApi$ParDoPayload$1.parsePartialFrom(RunnerApi.java:12633)
at org.apache.beam.model.pipeline.v1.RunnerApi$ParDoPayload$1.parsePartialFrom(RunnerApi.java:12627)
at org.apache.beam.vendor.grpc.v1p21p0.com.google.protobuf.AbstractParser.parsePartialFrom(AbstractParser.java:100)
at org.apache.beam.vendor.grpc.v1p21p0.com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:120)
at org.apache.beam.vendor.grpc.v1p21p0.com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:125)
at org.apache.beam.vendor.grpc.v1p21p0.com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:48)
at org.apache.beam.model.pipeline.v1.RunnerApi$ParDoPayload.parseFrom(RunnerApi.java:11130)
at org.apache.beam.runners.dataflow.worker.graph.RegisterNodeFunction.apply(RegisterNodeFunction.java:325)
... 10 more

Aggrid-treeGrid: Error: No component factory found for DetailPanelComponent

I am using angular 6.1, node 8.11.3 and i am trying to implement treeview with master details, same example provided here https://plnkr.co/edit/?p=preview. However I am getting below error and master detail component s not rendering on expansion of row details.
MasterComponent.html:1 ERROR Error: No component factory found for DetailPanelComponent. Did you add it to #NgModule.entryComponents?
at noComponentFactoryError (core.js:3258)
at CodegenComponentFactoryResolver.push../node_modules/#angular/core/fesm5/core.js.CodegenComponentFactoryResolver.resolveComponentFactory (core.js:3293)
at Ng2FrameworkComponentWrapper.push../node_modules/ag-grid-angular/dist/ng2FrameworkComponentWrapper.js.Ng2FrameworkComponentWrapper.createComponent (ng2FrameworkComponentWrapper.js:66)
at DynamicAgNg2Component.createComponent (ng2FrameworkComponentWrapper.js:45)
at DynamicAgNg2Component.push../node_modules/ag-grid-angular/dist/ng2FrameworkComponentWrapper.js.BaseGuiComponent.init (ng2FrameworkComponentWrapper.js:85)
at DynamicAgNg2Component.init (ng2FrameworkComponentWrapper.js:41)
at ComponentResolver.push../node_modules/ag-grid/dist/lib/components/framework/componentResolver.js.ComponentResolver.initialiseComponent (componentResolver.js:295)
at ComponentResolver.push../node_modules/ag-grid/dist/lib/components/framework/componentResolver.js.ComponentResolver.createAgGridComponent (componentResolver.js:246)
at rowComp.js:673
at rowContainerComponent.js:58
I am following exactly same thing as mention in example, but for Angular 6.
Please suggest.

MEAN stack Service Workers

I am using the MEAN stack using the Google's read-through-caching example.
Everytime I load or refresh, the error is
Uncaught (in promise) TypeError: Cannot set property 'textContent' of null(…)
in (the following code, line 112 ).
I changed the class from #status to #ng-scope to meet the main class to cache
document.querySelector('#ng-scope').textContent = error;
HTML file modification relative to the class it needs to cache
It still works but it's showing the error in red. I tried other solutions evaluating if the value is null but no luck or I am probably doing it wrong.

Dojo SyntaxError: missing ) in parenthetical

I have had this same error before and posted a question to that effect but unfortunately there was no answer. The previous error occurred under different circumstances ( ie I was triggered when I used the dojo toolkit sdk(Size 19M).
This time I am retrieving data from a couple of tables which have a one to many relationship. I am using Dojo, Doctrine and Zend Framework for my project. I have posted quite an extensive error message at 1 the Link to pastie.org with code and error details and the php and javascript that I identified as being the code involved.
When you look towards the end of the pastie in the FIREBUG ERROR MESSAGE section you will see a piece of JSON like
[{"id":"000001",
"name":"Adam",
"area_id":null,
"registration_date":"2011-03-08",
"loan_cycle":"0","credit_score":"100",
"created_by":null,
"borrowers":[{"id":"00000001",
"first_name":"Test",
"surname":"User",
"dob":"2006-12-09",
"personalid_no":"100000",
"gender":"Male",
"marital_status":"Marrie",
"home_number":"09866678",
"mobile_number":"09877655",
"accomodation_type":"owner",
"current_loan_cycle":"1",
"status":"Active",
"date_created":null,
"date_registered":"2009-12-11",
"created_by":null,
"Groups_id":"000001"}]
}]
Its clear that the data gets pulled from the tables. However the code fails and I get the error message SyntaxError: missing ) in parenthetical. I have battled with this for a long time now. Am at a point where I either have to abandon the application or restart the whole project again. Thanks for your help.

Resources