Skip to content

ERR_UNSUPPORTED_ESM_URL_SCHEME #246

@eraycetinx

Description

@eraycetinx

I'm using react-native-community/cli. I did everything according to the documentation but I am getting this error.

error Error loading Metro config at: C:\Project\metro.config.js Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'. Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:' at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:227:11) at defaultLoad (node:internal/modules/esm/load:109:3) at ModuleLoader.load (node:internal/modules/esm/loader:666:12) at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:479:43) at #createModuleJob (node:internal/modules/esm/loader:503:36) at #getJobFromResolveResult (node:internal/modules/esm/loader:274:34) at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:242:41) at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:542:25)

metro.config.js
`const { getDefaultConfig, mergeConfig } = require("@react-native/metro-config");
const { withNativeWind } = require("nativewind/metro");

const config = mergeConfig(getDefaultConfig(__dirname), {
/* your config */
});

module.exports = withNativeWind(config, { input: "./global.css" });`

repo: https://github.com/eraycetinx/workshopUI/tree/design (metro.config.js file is not modified)

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