doc_components
doc_components copied to clipboard
Internal server error on showcase
I got this error:
Listening on: http://0.0.0.0:3100/
[uncaught application error]: TypeError - Cannot read properties of undefined (reading 'toLowerCase')
request: { url: "http://0.0.0.0:3100/", method: "GET", hasBody: false }
response: { status: 404, type: undefined, hasBody: false, writable: true }
at file:///Users/hash/Documents/GitHub/doc_components/doc.ts:63:44
at Array.find (<anonymous>)
at getIndex (file:///Users/hash/Documents/GitHub/doc_components/doc.ts:63:24)
at ModulePathIndexPanel (file:///Users/hash/Documents/GitHub/doc_components/module_path_index_panel.tsx:152:23)
at renderFunctionalComponent (https://deno.land/x/[email protected]/core.ts:160:18)
at _render (https://deno.land/x/[email protected]/core.ts:134:70)
at https://deno.land/x/[email protected]/core.ts:46:17
at Array.forEach (<anonymous>)
at appendChildren (https://deno.land/x/[email protected]/core.ts:41:12)
at Object.h (https://deno.land/x/[email protected]/core.ts:286:3)
[error] TypeError: Cannot read properties of undefined (reading 'toLowerCase')
at file:///Users/hash/Documents/GitHub/doc_components/doc.ts:63:44
at Array.find (<anonymous>)
at getIndex (file:///Users/hash/Documents/GitHub/doc_components/doc.ts:63:24)
at ModulePathIndexPanel (file:///Users/hash/Documents/GitHub/doc_components/module_path_index_panel.tsx:152:23)
at renderFunctionalComponent (https://deno.land/x/[email protected]/core.ts:160:18)
at _render (https://deno.land/x/[email protected]/core.ts:134:70)
at https://deno.land/x/[email protected]/core.ts:46:17
at Array.forEach (<anonymous>)
at appendChildren (https://deno.land/x/[email protected]/core.ts:41:12)
at Object.h (https://deno.land/x/[email protected]/core.ts:286:3)
simply change to file?.toLowerCase() here works, but might need some typing fix.
https://github.com/denoland/doc_components/blob/main/doc.ts#L63
Yes, it is broken, as the data payload format changed and the code wasn't maintained. I had to hack any in there to get the showcase to actually pass type checking, but didn't fix the underlying code.
Need to make type checking the showcase work, as well as move over fully to static fixtures as well.