最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

I am trying to set up a typescript repo to use tsx for development but when ever I run tsx I get type errors - Stack Overflow

programmeradmin6浏览0评论

When I run the command tsx watch src/bootstrap/server.ts I get this error:

 TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined

the error points to this line of code:

const jwtKey = fs.readFileSync(process.env.JWT_PUBLIC_KEY as string)

This has never thrown any errors before and everything I find online praises how easy tsx is so I must be doing something wrong.

Currently this repo uses nodemon and runs with no problem, its just slow to recompile.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论