metro bundler crashing with Error: Must specify expo-platform header or query parameter

Please provide the following:

  1. SDK Version: 45
  2. Platforms(Android/iOS/web/all): android/ios

When I run expo start --dev-client, the metro bundler starts briefly and then crashes immediately with error:

Error: Must specify expo-platform header or query parameter
    at getPlatformFromRequest (/Users/.../node_modules/xdl/src/start/ExpoUpdatesManifestHandler.ts:34:11)
    at /Users/.../node_modules/xdl/src/start/ExpoUpdatesManifestHandler.ts:207:19

First time this error occurred, I updated expo-cli to latest version. It seemed to have fix it. But this morning, I started again to observe this crash (out of nowhere). Any help would be greatly appreciated.

diagnostics:


  expo-env-info 1.0.3 environment info:
    System:
      OS: macOS 12.3.1
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 14.18.1 - /var/folders/fs/mgcn9dds60114gl150cz1fk40000gn/T/yarn--1652361275866-0.05031357544957604/node
      Yarn: 1.22.15 - /var/folders/fs/mgcn9dds60114gl150cz1fk40000gn/T/yarn--1652361275866-0.05031357544957604/yarn
      npm: 8.3.0 - ~/.nvm/versions/node/v14.18.1/bin/npm
      Watchman: 2021.11.15.00 - /opt/homebrew/bin/watchman
    Managers:
      CocoaPods: 1.11.3 - /usr/local/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
    IDEs:
      Android Studio: 2020.3 AI-203.7717.56.2031.7935034
      Xcode: 13.2/13C5081f - /usr/bin/xcodebuild
    npmPackages:
      expo: ^45.0.0 => 45.0.1 
      react: 17.0.2 => 17.0.2 
      react-dom: 17.0.2 => 17.0.2 
      react-native: 0.68.1 => 0.68.1 
      react-native-web: 0.17.7 => 0.17.7 
    npmGlobalPackages:
      eas-cli: 0.52.0
      expo-cli: 5.4.3
    Expo Workflow: managed

I’m running expo sdk 44, and my iOS/Android apps don’t crash, but I’m getting the identical error when trying to implement Google sign in via expo-auth-session on a simulator via the Expo Go app.

Error: Must specify expo-platform header or query parameter
    at getPlatformFromRequest

Seems like an expo package is making a network request, but we need to provide the ‘expo-platform’ header in the request. Not sure where to modify that.

I’ll post back if I find anything.

1 Like

Hi @seyaobey.dev

Does it do this when you are not running the dev client on a device/simulator/emulator?

I’m a bit confused by the node and yarn binaries you have installed. They seem to be installed in a temporary location?

I’m not sure what’s going on, but it seems like maybe something is making an invalid request to the dev server (e.g. something other than the dev client is making a request), or maybe there’s some sort of version mismatch. e.g. maybe an old version of Expo Go or dev client with a new version of expo-cli?

1 Like

HI @wodin thank you for taking the time to look up this issue. Since I am at the beginning of the project, I have decided to rebuild it from scratch. It is working now, crossing my fingers and hoping not to meet again this error ahead one day…

1 Like