[expo-modules-core] ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING
Minimal reproducible example
https://gist.github.com/yawnt/06d7efd94298ec1bc8482d03085f4e24
What platform(s) does this occur on?
No response
Where did you reproduce the issue?
in Expo Go
Summary
I have a native module that loads expo-modules-core as part of its setup. Because expo-modules-core is published in Typescript, npx expo prebuild, npx expo doctor and other commands fail.
Environment
expo-env-info 1.3.3 environment info:
System:
OS: macOS 15.4.1
Shell: 5.9 - /bin/zsh
Binaries:
Node: 23.11.0 - /opt/homebrew/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.9.2 - /opt/homebrew/bin/npm
Watchman: 2025.04.28.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.16.2 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 24.4, iOS 18.4, macOS 15.4, tvOS 18.4, visionOS 2.4, watchOS 11.4
IDEs:
Xcode: 16.3/16E140 - /usr/bin/xcodebuild
npmGlobalPackages:
eas-cli: 13.4.1
Expo Workflow: managed
Expo Doctor Diagnostics
Error [ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING]: Stripping types is currently unsupported for files under node_modules, for "~/Code/saffron/node_modules/expo-modules-core/src/index.ts"
(node:76687) ExperimentalWarning: Type Stripping is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
Hi @yawnt! Thanks for reporting the issue. You are right that expo-modules-core is published as untranspiled TypeScript, it's mainly for Metro and React Compiler to perform optimizations based on the project setup.
I'm not sure why expo-modules-core is loaded during either expo prebuild or expo-doctor though. expo-modules-core is a library that was mainly built for React Native, and not Node. Can you share some reproducible steps on how to trigger that?
Keep in mind that expo-modules-core isn't a package that should be depend on directly. Instead, the expo package is tasked with setting this up properly. I'm not sure how you are setting it up in your own library?
Hi,
Thanks for getting back to me. I am using https://github.com/deeeed/expo-audio-stream which seems to use quite a lot of classes from that package.
https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/deeeed/expo-audio-stream%24+expo-modules-core&patternType=keyword&sm=0
Does that mean that's wrong and I should open an issue on that repo?
Hi,
I'm experiencing the same problem now. I also use this package https://www.npmjs.com/package/@siteed/expo-audio-studio?activeTab=readme I think it's just an updated version of what's @yawnt is using
This is an error that happens when I run npx expo prebuild or npx expo run
Error [ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING]: Stripping types is currently unsupported for files under node_modules, for "<path to expo prj>/node_modules/expo-modules-core/src/index.ts"
Error [ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING]: Stripping types is currently unsupported for files under node_modules, for "<path to expo prj>/node_modules/expo-modules-core/src/index.ts"
at stripTypeScriptModuleTypes (node:internal/modules/typescript:186:11)
at Module._compile (node:internal/modules/cjs/loader:1686:15)
at Object.loadTS [as .ts] (node:internal/modules/cjs/loader:1826:10)
at Module.load (node:internal/modules/cjs/loader:1469:32)
at Module._load (node:internal/modules/cjs/loader:1286:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
at Module.require (node:internal/modules/cjs/loader:1491:12)
at require (node:internal/modules/helpers:135:16)
at Object.<anonymous> (<path to expo prj>/node_modules/@siteed/expo-audio-studio/build/cjs/ExpoAudioStreamModule.js:6:29)
@yawnt have you found a solution?
What's funny everything worked fine, I just deleted my node_modules folder by mistake and then did the npm install once again and keep getting this error.
Clearly, the problem is in expo-audio-studio or stream package, because If you remove it from package.json everything works.
#https://github.com/deeeed/expo-audio-stream/issues/237
For me this happens when I reference expo-constants in the app.config.js
Seems this was solved in the expo-audio-stream repo. Happy to close, although publishing Typescript code to NPM is indeed a bit strange.
For me this happens when I reference
expo-constantsin the app.config.js
I had mistakenly added expo-constants to the plugins list in the app.config.js file. Removing it resolved the issue for me.
Thanks @wildseansy for the tip!
Also happens in expo-print and expo-sharing :q
I'm getting this error trying to install expo-web-browser
Also happens in expo-print and expo-sharing :q
I think I face the same problem, I am trying expo-print and expo-sharing, and this error happened haha. I still haven't found a solution for this. Do you have any solution?
I solved this issue by removing expo-task-manager and expo-device from my app.json & project.
Unfortunately, I'm not sure which library caused it.