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

When I run the commandtsx watch srcbootstrapserver.ts I get this error:TypeError [ERR_INVALID_ARG_T

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744076686a4554529.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信