expo / expo/eas-cli

[Android] Cannot use import statement outside a module

Open
#3,056 7 comments 0 reactions 0 assignees View on GitHub
needs review
Dominant language
TypeScript
Stars
1.4k
Forks
236
Avg merge
3d 1h
Merged PRs (30d)
91

Description

### Build/Submit details page URL

https://expo.dev/accounts/eos-care/projects/user-mobile/builds/93ead109-0495-4d24-b34b-357ebce8d8b5

### Summary

Hi, I'm importing .ts plugin files in my app.config.ts. I need to be on node version 20.19.2 at least, to be able to build.
On EAS, no problem for iOS build but on Android, the node version is 20.18.3, resulting in failing the build.

I already tried to manual set the node version in eas.json but without success. I can see the step `Install custom tools` installing the correct node version, but it doesn't seem to impact the `Read app config` step that still use the old node version.

Image

If I'm launching the eas command on local with `--local`, everything is working as it should

### Managed or bare?

managed

### Environment

expo-env-info 1.3.3 environment info:
System:
OS: macOS 15.5
Shell: 5.9 - /bin/zsh
Binaries:
Node: 23.11.0 - /opt/homebrew/bin/node
Yarn: 1.22.17 - /opt/homebrew/bin/yarn
npm: 10.9.2 - /opt/homebrew/bin/npm
Watchman: 2025.04.28.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.15.2 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 24.5, iOS 18.5, macOS 15.5, tvOS 18.5, visionOS 2.5, watchOS 11.5
IDEs:
Android Studio: 2024.2 AI-242.23726.103.2422.12816248
Xcode: 16.4/16F6 - /usr/bin/xcodebuild
npmPackages:
expo: 53.0.11 => 53.0.11
expo-router: ~5.1.0 => 5.1.0
expo-updates: ~0.28.14 => 0.28.14
react: 19.0.0 => 19.0.0
react-dom: 19.0.0 => 19.0.0
react-native: 0.79.3 => 0.79.3
react-native-web: ^0.20.0 => 0.20.0
Expo Workflow: bare

### Error output

Cannot use import statement outside a module

### Reproducible demo or steps to reproduce from a blank project

- Create a local plugin in a ts file.
- Import it in app.config.ts
- Use node version 20.18.3
- Try to npx expo prebuild

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.