koajs / koajs/static-cache

Cannot read property 'getTime' of undefined

Open
#99 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
291
Forks
48
PR merge metrics
No merged PRs in 30d

Description

使用 static-cache 作为静态文件托管,使用过程中,概率出现以下报错

```js

2021-12-30 10:14:09,663 ERROR 247 [-/-/172.16.224.25/64407ebb16408304496621596d00f7/2ms GET /public/common/bi.jpeg] ### onerror handle { TypeError: Cannot read property 'getTime' of undefined
at /xxxxl/node_modules/_koa-static-cache@5.1.4@koa-static-cache/index.js:86:48 status: 500 }
2021-12-30 10:15:17,903 ERROR 256 [-/-/172.16.224.25/64407ebb16408305179021481d0100/1ms GET /public/common/bi.jpeg] nodejs.TypeError: Cannot read property 'getTime' of undefined
at /xxxx/node_modules/_koa-static-cache@5.1.4@koa-static-cache/index.js:86:48
```

Contributor guide

Open the contributing guide

Research direction

Start at node_modules/_koa-static-cache@5.1.4@koa-static-cache/index.js:86 and trace the static-cache request path for /public/common/bi.jpeg. Reproduce the intermittent TypeError around getTime, then identify the relevant cache or file metadata state and add coverage for the failure; done means the request no longer returns status 500.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.