Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Next.js and React

tsconfig.json cannot find the file it extends in an Expo project

ErrorFile 'expo-module-scripts/tsconfig.base' not found.

Short answer

TypeScript resolves the extends value with Node.js-style resolution. If the package or the path in extends is misspelled, or the dependencies are not installed, the editor shows 'File not found'. Use expo/tsconfig.base, install expo and typescript, or regenerate the file with npx expo customize tsconfig.json.

  • Applies to Expo SDK 5x, TypeScript 5, VS Code
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Open tsconfig.json and compare its extends line character by character with the form Expo documents.

    grep -n "extends" tsconfig.json
    ls node_modules/expo/tsconfig.base* 2>&1
  2. 2Match what you see, then jump to its fix

    1. 1The quoted path in the error is not expo/tsconfig.baseThe extends value is misspelled or names a package you do not useFix
    2. 2node_modules is missing or node_modules/expo has no tsconfig.base fileDependencies are not installed, so the base file is not on diskFix

What does the error look like?

  • File 'expo-module-scripts/tsconfig.base' not found.

Cause 1 of 2

The extends value is misspelled or names a package you do not use

1Check

Expo documents that a project's tsconfig.json should extend expo/tsconfig.base by default. Any other name has to be a real package or file that exists on disk.

grep -n "extends" tsconfig.json

2Fix

Set extends to the Expo base, or regenerate the file from Expo.

{
  "extends": "expo/tsconfig.base"
}

# or regenerate
npx expo customize tsconfig.json

3Verify

Restart the TypeScript server in the editor and run the compiler.

npx tsc --noEmit

Confirmed by docs.expo.dev

Did this fix it?

Cause 2 of 2

Dependencies are not installed, so the base file is not on disk

1Check

TypeScript resolves extends with Node-style resolution, so the package must exist in node_modules. Check that expo is there.

ls node_modules/expo/package.json

2Fix

Install dependencies, and install the TypeScript packages the Expo docs name.

npm install
npx expo install typescript @types/react --dev

3Verify

The base file now exists and the error is gone after an editor restart.

ls node_modules/expo/tsconfig.base*

Confirmed by docs.expo.dev

Did this fix it?

How do I stop it coming back?

  • Generate tsconfig.json with npx expo customize tsconfig.json instead of copying one from another project.
  • Restart Expo CLI after you edit tsconfig.json, as the Expo docs advise.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Web apps

tsconfig rejects allowImportingTsExtensions

An error that allowImportingTsExtensions needs noEmit or emitDeclarationOnly

allowImportingTsExtensions lets files import each other with .ts or .tsx extensions, and TypeScript only allows it together with noEmit or emitDeclarationOnly.

2 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.