Skip to content

Malformed expo-modules-core in StackBlitz Node.js #1881

@scottannan

Description

@scottannan

Describe the bug

Expo's expo-modules-core package consistently installs malformed (index.js is null, build/ directory is missing .js files) in StackBlitz Node.js environments.

Link to the blitz that caused the error

https://stackblitz.com/edit/stackblitz-starters-rsmog8fz?description=Starter%20project%20for%20Node.js,%20a%20JavaScript%20runtime%20built%20on%20Chrome%27s%20V8%20JavaScript%20engine&file=index.js&title=node.new%20Starter

Steps to reproduce

  1. Go to https://node.new
  2. Open the terminal.
  3. Run the commands:
npm install expo@~52.0.0 expo-router@latest [email protected] [email protected] [email protected] react-native-web@~0.19.6
npx expo init --no-install # Choose "blank"
npm install
echo "module.exports = function(api) { api.cache(true); return { presets: ['babel-preset-expo'], }; };" > babel.config.js
echo "const { getDefaultConfig } = require('@expo/metro-config'); const config = getDefaultConfig(__dirname, { isCSSEnabled: true, }); module.exports = config;" > metro.config.js
head -n 10 node_modules/expo-modules-core/index.js
ls node_modules/expo-modules-core/build/

The output is incorrect:
module.exports = null;
& within the file, the js files have not been compiled:
EventEmitter.d.ts SharedObject.d.ts.map
EventEmitter.d.ts.map SharedRef.d.ts
LegacyEventEmitter.d.ts SharedRef.d.ts.map
LegacyEventEmitter.d.ts.map TypedArrays.types.d.ts
NativeModule.d.ts TypedArrays.types.d.ts.map
NativeModule.d.ts.map ensureNativeModulesAreInstalled.d.ts
NativeModulesProxy.d.ts ensureNativeModulesAreInstalled.d.ts.map
NativeModulesProxy.d.ts.map environment/
NativeModulesProxy.native.d.ts errors/
NativeModulesProxy.native.d.ts.map hooks/
NativeModulesProxy.types.d.ts index.d.ts
NativeModulesProxy.types.d.ts.map index.d.ts.map
NativeViewManagerAdapter.d.ts registerWebModule.d.ts
NativeViewManagerAdapter.d.ts.map registerWebModule.d.ts.map
NativeViewManagerAdapter.native.d.ts reload.d.ts
NativeViewManagerAdapter.native.d.ts.map reload.d.ts.map
PermissionsHook.d.ts requireNativeModule.d.ts
PermissionsHook.d.ts.map requireNativeModule.d.ts.map
PermissionsInterface.d.ts requireNativeModule.web.d.ts
PermissionsInterface.d.ts.map requireNativeModule.web.d.ts.map
Platform.d.ts sweet/
Platform.d.ts.map ts-declarations/
Refs.d.ts uuid/
Refs.d.ts.map web/
SharedObject.d.ts

This is throwing the TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" error.

Expected behavior

The expo modules should have compiled into js files.

Parity with Local

Screenshots

No response

Platform

Browser name  = Chrome
Full version  = 136.0.0.0
Major version = 136
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36
performance.memory = {
  "totalJSHeapSize": 112169801,
  "usedJSHeapSize": 110313605,
  "jsHeapSizeLimit": 4294705152
}
Hash = 55edb8f4

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions