Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS2339: Property files does not exist on type #43

Open
rzinnatullin opened this issue Jan 26, 2024 · 0 comments
Open

TS2339: Property files does not exist on type #43

rzinnatullin opened this issue Jan 26, 2024 · 0 comments

Comments

@rzinnatullin
Copy link

TypeScript project.
Installed npm i @types/express-busboy --save-dev.

My router method:

router.post("uploads", async (req, res) => {
    console.log(req.files);
}

Got compilation error on the console.log line:

error TS2339: Property 'files' does not exist on type 'Request<{ runId: string; } & { requestId: string; }, any, any, ParsedQs, Record<string, any>>'.

I understand that bb.extend(app... does nothing with the type info, thus we get the compilation error.
But since there's d.ts support for this package, how developers supposed to be accessing req.files w/o falling back to pure JavaScript way of thinking?

If it matters, I have "noImplicitAny": true compiler option set in tsconfig.json, so it's restricted to cast req to any.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant