Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The runtime does not package the babel helpers while snackager uses runtime-transform #299

Open
mmomtchev opened this issue May 24, 2022 · 1 comment · May be fixed by #302
Open

The runtime does not package the babel helpers while snackager uses runtime-transform #299

mmomtchev opened this issue May 24, 2022 · 1 comment · May be fixed by #302

Comments

@mmomtchev
Copy link

Summary

My module exports a main and a module with the module using ES6 syntax which makes Babel to insert a couple of helpers:

yarn bundle @mmomtchev/react-native-settings@1.0.3 | ./node_modules/.bin/bunyan
file: /tmp/@mmomtchev/react-native-settings/web-bundle.js
--
externals: [
  "@babel/runtime/helpers/interopRequireDefault",
  "@babel/runtime/helpers/slicedToArray",
  "@react-navigation/native-stack",
  "react",
  "react-native"
]

What platform(s) does this occur on?

Web

SDK Version

v44.0.0

Reproducible demo or steps to reproduce from a blank project

https://snack.expo.dev/@mmomtchev/@mmomtchev-react-native-settings

@mmomtchev
Copy link
Author

I was able to narrow the problem to that fact that my module has type: "module" and I was able to reproduce the problem outside of snackager with raw webpack and presets: [ 'module:metro-react-native-babel-preset']

mmomtchev added a commit to mmomtchev/snack that referenced this issue May 25, 2022
Refs: expo#299
Refs: microsoft/rnx-kit#142

The Metro Babel preset does not produce correct output
for packages containing "type": "module" unless
the disableImportExportTransform options is used to
prevent it from including @babel/plugin-transform-modules-commonjs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant