Skip to content

Import of headless.conf.js breaks in Windows due to incorrect pathname #866

Description

@uglyrobot

Describe the bug

Using NextJS 14.2 in Windows dev environment. Throws errors that it can't import the config file, and the pathname in the errors is missing the slashes: c:somethingSomethingDirheadless.config.js

I confirmed that merging the configs with withHeadlessConfig() the output is ok, so loading the config in next.config.js is working fine, it's the loading in the package that breaks.

Steps to Reproduce

  • Run npm run dev in Windows
  • Get compile errors

Screenshots, screen recording, code snippet

No response

Environment information

NextJS 14.2.13
Windows
Nodejs 20

WordPress information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. nicholasio commented on Sep 27, 2024

    @nicholasio
    Member

    Thanks for the report.

    While I'd typically recommend using WSL2, this should be an easy fix, we just need to make path resolution in withHeadstartWPConfig cross-platform and alongside that include windows to run our test builds in CI.

  2. Skiler6348 commented on Dec 2, 2024

    @Skiler6348

    Did you fix it? I still have the same error

  3. added a commit that references this issue on Apr 25, 2025
    fbcad53
  4. nicholasio commented on Apr 25, 2025

    @nicholasio
    Member

    This has been fixed (but not yet released). A separate issue on windows has been opened #902 which seems to be a Next.js issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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