React-native: React Native does not bundle files with --projectRoot

Created on 12 Apr 2019  路  3Comments  路  Source: facebook/react-native

馃悰 Bug Report

I want to move my index.tsx file to the src dir, instead of root directory. I tried to set project root as cli param:
"start": "node node_modules/react-native/local-cli/cli.js start --projectRoot src"

And when bundle runs I see:

error: bundling failed: Error: Unable to resolve module @babel/runtime/helpers/interopRequireDefault from /Users/alexm/Documents/Projects/Stuzo/Investigations/PayomaticMobile/src/index.tsx: Module @babel/runtime/helpers/interopRequireDefault does not exist in the Haste module map

To Reproduce

  1. react-native init
  2. move source code files to the ./src folder
  3. add config to the metro.config.js
    > resolver: {
    sourceExts: ['js', 'ts', 'tsx'],
    },

Expected Behavior

Code should bundle correctly

Environment

[skip envinfo]
I think this info is enough
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.59.4 => 0.59.4
npmGlobalPackages:
react-native-cli: 2.0.1

Bug Locked 馃摝Bundler

Most helpful comment

why is this issue closed?
a workaround is not a solution, it is still an issue.

All 3 comments

Can you run react-native info and edit your issue to include these results under the Environment section?

If you believe this information is irrelevant to the reported issue, you may write [skip envinfo] alongside an explanation in your Environment: section.

This is a regression after a packager fix in 0.59.3.

You can work around it by using watchFolders option in metro.config.js instead

why is this issue closed?
a workaround is not a solution, it is still an issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

grabbou picture grabbou  路  3Comments

despairblue picture despairblue  路  3Comments

lazywei picture lazywei  路  3Comments

oney picture oney  路  3Comments

josev55 picture josev55  路  3Comments