I have cloned the Vercel NextJS app router playground repo at https://github.com/vercel/next-app-router-playground to my Windows machine.
Then I run
pnpm install
pnpm dev
The app homepage works fine, but when I click on some of the links, for example in Parallel Routes, I get this error:
Error evaluating Node.js code
Error: 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:209:11)]
[at defaultLoad (node:internal/modules/esm/load:107:3)]
[at ModuleLoader.load (node:internal/modules/esm/loader:670:12)]
[at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:483:43)]
[at #createModuleJob (node:internal/modules/esm/loader:507:36)]
[at #getJobFromResolveResult (node:internal/modules/esm/loader:275:34)]
[at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:243:41)]
[at process.processTicksAndRejections (node:internal/process/task_queues:105:5)]
[at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:546:25)]
at BuildError (http://localhost:3000/_next/static/chunks/bb4a0_next_dist_client_7b968f69._.js:14628:41)
at react-stack-bottom-frame (http://localhost:3000/_next/static/chunks/bb4a0_next_dist_compiled_react-dom-experimental_67fd9cae._.js:15032:24)
at renderWithHooksAgain (http://localhost:3000/_next/static/chunks/bb4a0_next_dist_compiled_react-dom-experimental_67fd9cae._.js:4366:24)
at renderWithHooks (http://localhost:3000/_next/static/chunks/bb4a0_next_dist_compiled_react-dom-experimental_67fd9cae._.js:4317:28)
at updateFunctionComponent (http://localhost:3000/_next/static/chunks/bb4a0_next_dist_compiled_react-dom-experimental_67fd9cae._.js:5754:21)
at beginWork (http://localhost:3000/_next/static/chunks/bb4a0_next_dist_compiled_react-dom-experimental_67fd9cae._.js:6347:24)
at runWithFiberInDEV (http://localhost:3000/_next/static/chunks/bb4a0_next_dist_compiled_react-dom-experimental_67fd9cae._.js:903:74)
at performUnitOfWork (http://localhost:3000/_next/static/chunks/bb4a0_next_dist_compiled_react-dom-experimental_67fd9cae._.js:9562:97)
at workLoopSync (http://localhost:3000/_next/static/chunks/bb4a0_next_dist_compiled_react-dom-experimental_67fd9cae._.js:9456:40)
at renderRootSync (http://localhost:3000/_next/static/chunks/bb4a0_next_dist_compiled_react-dom-experimental_67fd9cae._.js:9440:13)
at performWorkOnRoot (http://localhost:3000/_next/static/chunks/bb4a0_next_dist_compiled_react-dom-experimental_67fd9cae._.js:9126:190)
at performWorkOnRootViaSchedulerTask (http://localhost:3000/_next/static/chunks/bb4a0_next_dist_compiled_react-dom-experimental_67fd9cae._.js:10332:9)
at MessagePort.performWorkUntilDeadline (http://localhost:3000/_next/static/chunks/bb4a0_next_dist_compiled_9d285066._.js:2039:64)
./app/parallel-routes/layout.tsx:8:1
Export default doesn't exist in target module
6 | import { type Metadata } from 'next';
7 | import React from 'react';
> 8 | import readme from './readme.mdx';
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9 |
10 | export async function generateMetadata(): Promise<Metadata> {
11 | const demo = getDemoMeta('parallel-routes');
The export default was not found in module [project]/app/parallel-routes/readme.mdx.tsx [app-rsc] (ecmascript).
The module has no exports at all.
All exports of the module are statically known (It doesn't have dynamic exports). So it's known statically that the requested export doesn't exist.
It seems that the error is thrown at line 8 of the file at ./app/parallel-routes/layout.tsx
import readme from './readme.mdx';
I have tried using async load of the import but the error is the same.
If I comment out the import line and its references, the page loads fine.
Any ideas?