Next.js Discord

Discord Forum

Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]

Answered
American Crocodile posted this in #help-forum
Open in Discord
American CrocodileOP
When i try to npm run dev

It tells me: An error occurred in next/font.

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 'd:'

at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:239:11)

at defaultLoad (node:internal/modules/esm/load:130:3)

at ModuleLoader.load (node:internal/modules/esm/loader:403:13)

at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:285:56)

at new ModuleJob (node:internal/modules/esm/module_job:67:26)

at #createModuleJob (node:internal/modules/esm/loader:297:17)

at ModuleLoader.getJobFromResolveResult (node:internal/modules/esm/loader:254:34)

at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:235:17)

at async ModuleLoader.import (node:internal/modules/esm/loader:322:23)

⨯ app\layout.tsx

An error occurred in next/font.



layout code:

import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";

const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
};

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
</html>
);
}
Answered by joulev
Try this @American Crocodile @Smalandstövare @Great golden digger wasp: https://github.com/vercel/next.js/issues/64371#issuecomment-2050735468
View full answer

8 Replies

American CrocodileOP
layout's code

import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";

const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
};

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
</html>
);
}
Smalandstövare
same thing started happening for me a few hours ago ^^
Great golden digger wasp
same thing now
Great golden digger wasp
npx create-next-app@latest
move to directory
npm run dev
just happen today
Try this @American Crocodile @Smalandstövare @Great golden digger wasp: https://github.com/vercel/next.js/issues/64371#issuecomment-2050735468
Answer
Smalandstövare
looks like they fixed it in the latest release also