-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Unable to resolve module @babel/runtime/helpers/interopRequireDefault
– without changing anything
#27712
Comments
I am also having this issue. If you troubleshoot a bit, you will find out that there is an issue when building the haste-map. Try to 1) locate this line in node_modules/jest-haste-map/build/index.js
and restart the packager with the reset option I am not sure why nothing is loaded when using watchman, I have symlinks and use Using macos, watchman 4.9.0 and latest rn |
I will try to debug this, thanks. Watchman 4.9.0 has been the latest version since 2017, so it's weird that this would just occur now. In the meantime I could reproduce on macOS and Linux, but my colleague running the same project under Linux has no issues running it. I will compare his utility versions. I could somehow get my project running by reverting to an older commit, removing |
I can confirm that changing the following in const crawl =
canUseWatchman && this._options.useWatchman
? _watchman.default
: _node.default; Change to: const crawl =
canUseWatchman && this._options.useWatchman
? _node.default
: _node.default; |
so weird right! glad to see it's not just me |
Note: Instead of modifying the file, I've uninstalled |
@slhck any update on this issue as I also use wml in Linux and now, watchman also causes the same error as soon as I run watch-del-all on the project. I tried uninstalling watchman and installed it again but when I build my project and run wml start to copy the local dependency and run the project, I get another error that the local dependency is not found in node_modules but when I run watch-del-all again, it's found but the problem with the node_modules/jest-haste-map/build/index.js starts again. @nonotest do you have another way of fixing it because going into that file to change it isn't good. |
Sorry no other way.. :(
…On Wed, 5 Feb 2020 at 5:47 pm, Oscar ***@***.***> wrote:
@slhck <https://github.com/slhck> any update on this issue as I also use
wml in Linux and now, watchman also causes the same error as soon as I run
watch-del-all on the project. I tried uninstalling watchman and installed
it again but when I build my project and run wml start to copy the local
dependency and run the project, I get another error that the local
dependency is not found in node_modules but when I run watch-del-all again,
it's found but the problem with the
node_modules/jest-haste-map/build/index.js starts again.
@nonotest <https://github.com/nonotest> do you have another way of fixing
it because going into that file to change it isn't good.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#27712?email_source=notifications&email_token=AATO4LKD2DCKB2DRKYS2RB3RBKDLHA5CNFSM4KEK2SJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEK2ZG3Q#issuecomment-582325102>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AATO4LOEC4Y36QZV7MTF3BTRBKDLHANCNFSM4KEK2SJA>
.
|
Sorry, I haven't figured out any other solution. Just get rid of |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
It's not fixed |
基础包过于简单导至babel_runtime_helpers_interopRequireDefault没有引入 |
I'm having the same issue on iOS EDIT: On both OS, Android and iOS |
Getting same error. Yarn add @babel/runtime not working. react-native start --reset-cache not working. Uninstalling watchman not working. Below command is also not working for me. React Native Environment Info: If there are some other solutions, please suggest. Totally stuck at this problem for 2 days. |
Same situation, only watchman deleting helps but that's not the solution because my other project requires watchman |
This is the last suggestion of the message to try these things:
|
maybe it helps to fix the problem: and the operating system says PATH NOT FOUND At the same time, my env: Windows 10, RN 0.63.3, Monorepo |
as was mentioned above, looks like the presence of this property BTW in my case,
developing mode ( npmPackages: |
I had the same error message but only when using Formik (in expo snack only ) so i found this solution:
|
I accidentally deleted my node_modules and package-lock.json. I used
Hope this helps you. |
Resolved by |
For anyone coming with the same issue but on |
For anyone seeing this with Expo in a monorepo, I had the wrong /**
* @type {import('expo/metro-config')}
*/
const { getDefaultConfig } = require('expo/metro-config')
const path = require('path')
const projectRoot = __dirname
const workspaceRoot = path.resolve(__dirname, '../..')
const config = getDefaultConfig(projectRoot)
config.watchFolders = [workspaceRoot]
config.resolver.nodeModulesPaths = [
path.resolve(projectRoot, 'node_modules'),
path.resolve(workspaceRoot, 'node_modules'),
]
config.resolver.extraNodeModules = {
modules: workspaceRoot,
}
console.log('config', config)
module.exports = config I had to change it from |
I am setting a monorepo right now and your pointer was a solution for me, editing module.exports = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
},
}; to const resolve = require('path').resolve;
const WORKSPACE_ROOT = resolve(PROJECT_ROOT, '../../');
console.log(PROJECT_ROOT);
module.exports = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
},
watchFolders: [WORKSPACE_ROOT],
}; |
Update to metro.config.js explained in this issue: facebook/react-native#27712
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
Of interest: I found this happens with As mentioned above, in my case the solution was to add the monorepo root to the watch folders: #27712 (comment) |
Deleting watchman fixes it. |
Understood a bit better now. This happens when running bare React Native projects in monorepos because the bare React Native's default Metro config does not include the monorepo root as a watchFolder (and What you can do is use Microsoft's @rnx-kit/metro-config instead, which supports monorepos out of the box (as well as supporting npm install --save-dev @rnx-kit/metro-config Now change your -const { getDefaultConfig, mergeConfig } = require("@react-native/metro-config");
+const { makeMetroConfig } = require("@rnx-kit/metro-config");
-
-/**
- * Metro configuration
- * https://facebook.github.io/metro/docs/configuration
- *
- * @type {import('metro-config').MetroConfig}
- */
-const config = {};
-
-module.exports = mergeConfig(getDefaultConfig(__dirname), config);
+module.exports = makeMetroConfig({
+ transformer: {
+ getTransformOptions: async () => ({
+ transform: {
+ experimentalImportSupport: false,
+ inlineRequires: false,
+ },
+ }),
+ },
+}); |
React Native version:
Steps To Reproduce
I opened a project that I've been working on for a few weeks, and I decided to run it after not having touched it for a few days:
npx react-native start
npx react-native run-android
I expected the project to start in Android. Instead, I got:
Of course, the file exists:
So I don't know why it wouldn't find it. Note that I have not changed anything in the project, and even reverting to an old commit from a few weeks ago does not solve this problem.
A colleague of mine has exactly the same project and can run it without problems. I have even tried to run a copy of his directory including the downloaded
node_modules
folder, and it fails.I could also reproduce this on a fresh install of NVM and Node under macOS.
I could not reproduce this in a completely new RN project. But cloning my project into another folder and running npm install, the error persists.
Trying the following did not work:
This is the package.json:
I have seen:
but none of the solutions there worked for me.
The text was updated successfully, but these errors were encountered: