Skip to content

Error: Failed to get SHA-1 for <projectPath>\node_modules\metro-runtime\src\polyfills\require.js #1771

Description

@danielaloycedaniel

I have been getting this error below. I do not know if it's me messing up or metro itself messing things up:


ERROR

Error: Failed to get the SHA-1 for: C:\dev\app\project\node_modules\metro-runtime\src\polyfills\require.js.

Potential causes:

1) The file is not watched. Ensure it is under the configured `projectRoot or watchFolders.

2) Check blocklist in your metro.config.js and make sure it isn't excluding the file path.

try refreshing your app. 

3) The file may have been deleted since it was resolved

4) Otherwise, this is a bug in Metro or the configured resolver please report it.

DependencyGraph.getOrComputeShal (C:\dev\app\project\node_modules\metro\src\node-haste\DependencyGraph.js:202:13)

at process.processTicksAndRejections (node:internal/process/task_queues: 103:5) at

at async Transformer.transformFile (C:\dev\app\project\node_modules\metro\src\DeltaBundler\Transformer.js:102:22)

Am running on:  node version: v24.13.0

npm version: 11.17.0

And my metro.config.js:

const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
const path = require('path');

/**
 * Metro configuration
 * https://reactnative.dev/docs/metro
 *
 * @type {import('@react-native/metro-config').MetroConfig}
 */
const config = {
  projectRoot: path.resolve(__dirname),
};

module.exports = mergeConfig(getDefaultConfig(__dirname), config);

I have tried to deleted metro cache on temp folder, deleting package-lock.json, deleting npm_modules and running npm install but nothing seems to work at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions