Closed b3b00 closed 6 months ago
Hello @kwhitley , is there any news about this issue ?
Sorry this slipped by the radar, Olivier, I'll dive into it today!
So... I'm not seeing the erros you're seeing... when running dev
which I assume is what I was supposed to run, I get the following (without errors). Only thing I saw was wrangler asking for a compatability date.
Which I assume is using _worker.js
, not _worker.ts
, if that matters (I assume it does)
Sorry, the issue occurs when compiling typescript To js, situer direct using tsc
or with npm run build
on m'y repo.
@kwhitley , maybe it comes from my steup. so here it is :
updatinf tsc to
Whoa... that's a super old version of Node (given we're on 20 and most libs barely support back as far as 16)...
Installing now to test though! :)
Houps this is 18.16 ☺️
The same errors happen on cloudflare when deploying. There versions are : Node 18.17.109 Nom 9.6.7 Typescript 5.4.5
So i 've finally found a way to fix this compilation issue. It was an tsconfig.json problem. See my commit here : https://github.com/b3b00/minimal-cloudflare-itty-router-5/commit/0641513d834a65087cd0c4f8a5490feb6f91219b The interresting part is
"skipLibCheck": true,
Thanks so much for your time trying to help. Hope this could help other users facing the same issue.
Nice catch! I'll have to do some testing with tsconfig flags and find the interactions that users may get stuck in...
Def need a trouble shooting guide... if nothing else for the hung promise folks get when still using router.handle
, haha.
This continues to be an issue even after updating tsconfig.json
[vite:dts] Internal Error: Unable to follow symbol for "StatusError"
You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.
at AstSymbolTable._analyzeChildTree (/home/zmccoy/sandbox/unicornx-api/node_modules/.pnpm/@microsoft+api-extractor@7.43.0_@types+node@20.14.2/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:328:43)
at AstSymbolTable._analyzeChildTree (/home/zmccoy/sandbox/unicornx-api/node_modules/.pnpm/@microsoft+api-extractor@7.43.0_@types+node@20.14.2/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:377:18)
at AstSymbolTable._analyzeChildTree (/home/zmccoy/sandbox/unicornx-api/node_modules/.pnpm/@microsoft+api-extractor@7.43.0_@types+node@20.14.2/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:377:18)
at AstSymbolTable._analyzeChildTree (/home/zmccoy/sandbox/unicornx-api/node_modules/.pnpm/@microsoft+api-extractor@7.43.0_@types+node@20.14.2/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:377:18)
at AstSymbolTable._analyzeChildTree (/home/zmccoy/sandbox/unicornx-api/node_modules/.pnpm/@microsoft+api-extractor@7.43.0_@types+node@20.14.2/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:377:18)
at AstSymbolTable._analyzeChildTree (/home/zmccoy/sandbox/unicornx-api/node_modules/.pnpm/@microsoft+api-extractor@7.43.0_@types+node@20.14.2/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:377:18)
at AstSymbolTable._analyzeChildTree (/home/zmccoy/sandbox/unicornx-api/node_modules/.pnpm/@microsoft+api-extractor@7.43.0_@types+node@20.14.2/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:377:18)
at AstSymbolTable._analyzeChildTree (/home/zmccoy/sandbox/unicornx-api/node_modules/.pnpm/@microsoft+api-extractor@7.43.0_@types+node@20.14.2/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:377:18)
at AstSymbolTable._analyzeChildTree (/home/zmccoy/sandbox/unicornx-api/node_modules/.pnpm/@microsoft+api-extractor@7.43.0_@types+node@20.14.2/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:377:18)
at AstSymbolTable._analyzeAstSymbol (/home/zmccoy/sandbox/unicornx-api/node_modules/.pnpm/@microsoft+api-extractor@7.43.0_@types+node@20.14.2/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:247:18)
ELIFECYCLE Command failed with exit code 1.
@b3b00 's fix remains the same:
for RouterOptions.d.ts
and RouterTypes.d.ts
before
import { StatusError } from 'StatusError';
after
// note the "../" before StatusError
import { StatusError } from '../StatusError';
So, if you want to build a library and include this package (via some external CI process) then you will need to patch
the package post-install, or revert to most recent version without the issue: 5.0.12
Hello,
I think I am facing the same issue as #237 when using itty-router v 5.0.17
I get the following errors
I tried to fix it modifying the 6 mentionned *.d.ts files as below
for html.d.ts, jpeg.d.ts, json.d.ts, png.d.ts, text.d.ts and webp.d.ts before
after
for RouterOptions.d.ts and RouterTypes.d.ts before
after
I works as expected but I should not have to do this kind of hackish thing. Is there something wrong ?
I 've made a full minimal reproduction case here : https://github.com/b3b00/minimal-cloudflare-itty-router-5
thanks for your work,
Olivier