Skip to content

fix: include filename extension in imports#209

Merged
gmaclennan merged 1 commit into
mainfrom
fix/import-filename-extensions
Jul 23, 2026
Merged

fix: include filename extension in imports#209
gmaclennan merged 1 commit into
mainfrom
fix/import-filename-extensions

Conversation

@gmaclennan

Copy link
Copy Markdown
Member

Local imports in src/ did not include the filename extension .js, and the inherited tsconfig from expo-module-scripts/tsconfig.base uses "moduleResolution": "bundler" which is basically "the bundler will deal with it", and tsc just passes it through unmodified. Metro under strict ESM mode though refuses to add the .js extension to imports that miss them (previous versions of Metro were more lenient).

Two fixes:

  1. Add the missing file extensions
  2. "moduleResolution": "nodenext" in tsconfig.json so that a missing extension is a compile error.

@gmaclennan
gmaclennan enabled auto-merge July 23, 2026 09:00
@gmaclennan gmaclennan self-assigned this Jul 23, 2026
@github-actions github-actions Bot added the fix Bug fix (changelog) label Jul 23, 2026
@gmaclennan
gmaclennan force-pushed the fix/import-filename-extensions branch from 2383eb5 to 3e02485 Compare July 23, 2026 12:19
@gmaclennan
gmaclennan added this pull request to the merge queue Jul 23, 2026
Merged via the queue into main with commit 0ee4536 Jul 23, 2026
24 checks passed
@gmaclennan
gmaclennan deleted the fix/import-filename-extensions branch July 23, 2026 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix (changelog)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant