Next.js Discord

Discord Forum

Build Error

Answered
Norwegian Forest Cat posted this in #help-forum
Open in Discord
Norwegian Forest CatOP
Build Error
Failed to compile

Next.js (14.2.0)
src\app\layout.tsx
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 'c:'
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)
This error occurred during the build process and can only be dismissed by fixing the error.
Answered by Arinji
Its a 14.2.0 thing, https://github.com/vercel/next.js/issues/64372
I would downgrade to 14.1.0 till the update... stabilizes itself
View full answer

65 Replies

Norwegian Forest CatOP
This is my layout.tsx file

import type { Metadata } from "next";
import { ThemeProvider } from "@/providers/theme-provider";
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}>
      <ThemeProvider
            attribute="class"
            defaultTheme="system"
            enableSystem
            disableTransitionOnChange
          >

            {children}
        </ThemeProvider>
        </body>
    </html>
  );
}
Its a 14.2.0 thing, https://github.com/vercel/next.js/issues/64372
I would downgrade to 14.1.0 till the update... stabilizes itself
Answer
@Norwegian Forest Cat
npm i next@14.1.0
yup
@Arinji yup
Norwegian Forest CatOP
legend
this is what mine looks
good... design
Norwegian Forest CatOP
but its meant to look like this
oh
i would just delete the whole project
14.2.0 is very fucked atm
Norwegian Forest CatOP
damn
so when i start it again
I just run
so the project they setup, would also be fucked
Norwegian Forest CatOP
npm i next@14.1.0
once i have the new folder
or when should i download it
just do npx create-next-app@14.1.0
Norwegian Forest CatOP
ty
in a new folder
@Arinji in a new folder
Norwegian Forest CatOP
I just looked at your portfolio
very nice
lets stay in contact
awh thanks :D
Norwegian Forest CatOP
😄
@Arinji awh thanks :D
Norwegian Forest CatOP
Do you currently take work? Or would work with a team
u do freelancing ?
@Norwegian Forest Cat Do you currently take work? Or would work with a team
this might be better in dm's since all the forums get indexed :D
Norwegian Forest CatOP
Okay
Norwegian Forest CatOP
thanks
@Norwegian Forest Cat thanks
If your issue is fixed, mark a solution :D
Norwegian Forest CatOP
npx create-next-app@14.1.0 . --typescript --tailwind --eslint
@Arinji If your issue is fixed, mark a solution :D
Norwegian Forest CatOP
let me see
when i get to that stage again
@Norwegian Forest Cat npx create-next-app@14.1.0 . --typescript --tailwind --eslint
looks correct, i usually just let the built setup do the options
@Arinji looks correct, i usually just let the built setup do the options
Norwegian Forest CatOP
legend
it worked
no worries, even im still on 14.1.0 and i live by living on the blazing edge xD
Norwegian Forest CatOP
Original message was deleted
follow this and mark a solution :D
Norwegian Forest CatOP
It failed to create a certificate
@Norwegian Forest Cat Click to see attachment
thanks for the flashbang:meow_stare:
Norwegian Forest CatOP
⚠ Self-signed certificates are currently an experimental feature, use at your own risk.
Attempting to generate self signed certificate. This may prompt for your password
⨯ Failed to generate self-signed certificate. Falling back to http. Error: Command failed: "C:\Users\abdul\AppData\Local\mkcert\mkcert-v1.4.4-windows-amd64.exe" -install -key-file "C:\Users\abdul\Desktop\webprodigies-fuzzie-app\certificates\localhost-key.pem" -cert-file "C:\Users\abdul\Desktop\webprodigies-fuzzie-app\certificates\localhost.pem" localhost 127.0.0.1 ::1
at genericNodeError (node:internal/errors:984:15)
at wrappedFn (node:internal/errors:538:14)
at checkExecSyncError (node:child_process:890:11)
at execSync (node:child_process:962:15)
at createSelfSignedCertificate (C:\Users\abdul\Desktop\webprodigies-fuzzie-app\node_modules\next\dist\lib\mkcert.js:122:37)
at async runDevServer (C:\Users\abdul\Desktop\webprodigies-fuzzie-app\node_modules\next\dist\cli\next-dev.js:293:35)
at async nextDev (C:\Users\abdul\Desktop\webprodigies-fuzzie-app\node_modules\next\dist\cli\next-dev.js:308:5)
at async main (C:\Users\abdul\Desktop\webprodigies-fuzzie-app\node_modules\next\dist\bin\next:155:5) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 21012,
stdout: null,
stderr: null
}
Norwegian Forest CatOP
/** @type {import('next').NextConfig} */
const nextConfig = {};

export default nextConfig;
.mjs
it worked the first time and it prompted making me click yes
now it doesnt work
@Arinji show your next config
Norwegian Forest CatOP
It worked
After I used
admin
yea
Norwegian Forest CatOP
@Arinji https://github.com/vercel/next.js/issues/56276
Norwegian Forest CatOP
thanks
should i mark as done
mark the first part as the answer
your second question is unrelated to the Build Error you ad at first
@Arinji yupz
Norwegian Forest CatOP
💀
@Norwegian Forest Cat 💀
make a new forum :(