Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mdx js loader: paths must be valid file:// URLs (windows only) #74564

Open
chrisweb opened this issue Jan 6, 2025 · 1 comment · May be fixed by #74565
Open

mdx js loader: paths must be valid file:// URLs (windows only) #74564

chrisweb opened this issue Jan 6, 2025 · 1 comment · May be fixed by #74565
Labels
bug Issue was opened via the bug report template. Markdown (MDX) Related to Markdown with Next.js.

Comments

@chrisweb
Copy link
Contributor

chrisweb commented Jan 6, 2025

Link to the code that reproduces this issue

https://github.com/chrisweb/nextjs_mdx-js-loader_windows_reproduction

To Reproduce

  1. clone the repo (git clone https://github.com/chrisweb/nextjs_mdx-js-loader_windows_reproduction.git)
  2. install the dependencies (npm i)
  3. run the development server (npm run dev)

Current vs. Expected behavior

if you are on windows you will now get an error in your terminal and can also see it if you open localhost:3000 in your browser

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

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 10
Binaries:
  Node: 23.5.0

Which area(s) are affected? (Select all that apply)

Markdown (MDX)

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

bug is windows specific, turbopack needs to be enabled, mdx support in next.config using @next/mdx, using mdx plugins where name is a string and options need to be serializable (this example has no options for simplicity)

@chrisweb chrisweb added the bug Issue was opened via the bug report template. label Jan 6, 2025
@github-actions github-actions bot added the Markdown (MDX) Related to Markdown with Next.js. label Jan 6, 2025
chrisweb added a commit to chrisweb/next.js that referenced this issue Jan 6, 2025
@chrisweb chrisweb linked a pull request Jan 6, 2025 that will close this issue
@himself65
Copy link
Contributor

Related: nodejs/node#31710

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. Markdown (MDX) Related to Markdown with Next.js.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants