Skip to Content

Property 'context' does not exist on type 'Require'

Learn how to resolve the TypeScript error "Property 'context' does not exist on type 'Require'" when using Webpack.

karchunt

Kar Chun Tan

Creator

Metadata

Thu May 01 2025

1 min read

55 words

Property ‘context’ does not exist on type ‘Require’

The error Property ‘context’ does not exist on type ‘Require’ typically occurs in TypeScript projects that use Webpack require.context. This happens because TypeScript by default does not recognize the context property on the Require type.

To resolve this issue, you need to install the type definitions for Webpack.

npm i -D @types/webpack-env
Last updated on