Skip to content

Fix: add cross-platform changes to allow building on Windows #326

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bjones1
Copy link

@bjones1 bjones1 commented May 1, 2025

To get this running on Windows, I had to add a dependency on react-dom; otherwise, this caused conflicts when running npm update. As shown below, the dependency conflict stems from npm selecting the latest version of react-dom, which in turn select the latest react, which conflicts with v18 of react needed elsewhere.

Since this is my first Doenet PR, please let me know what changes are needed.

# npm resolution error report

While resolving: [email protected]
Found: [email protected]
node_modules/react
  peer react@"^17.0.0 || ^18.0.0 || ^19.0.0" from @ariakit/[email protected]
  node_modules/@ariakit/react
    dev @ariakit/react@"^0.4.17" from the root project
  peer react@"^19.1.0" from [email protected]
  node_modules/react-dom
    peer react-dom@"^17.0.0 || ^18.0.0 || ^19.0.0" from @ariakit/[email protected]
    node_modules/@ariakit/react
      dev @ariakit/react@"^0.4.17" from the root project
    peer react-dom@">=16.8.0" from @uiw/[email protected]
    node_modules/@uiw/react-codemirror
      dev @uiw/react-codemirror@"^4.23.10" from the root project
    peer react-dom@">=18" from [email protected]
    node_modules/nextra
      dev nextra@"^3.3.1" from the root project
      nextra@"^3.3.1" from @doenet/[email protected]
      packages/docs-nextra
        @doenet/[email protected]
        node_modules/@doenet/docs-nextra
          workspace packages\docs-nextra from the root project
      peer nextra@"3.3.1" from [email protected]
      node_modules/nextra-theme-docs
        dev nextra-theme-docs@"^3.3.1" from the root project
        nextra-theme-docs@"^3.3.1" from @doenet/[email protected]
        packages/docs-nextra
          @doenet/[email protected]
          node_modules/@doenet/docs-nextra
            workspace packages\docs-nextra from the root project
    peer react-dom@"^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0" from [email protected]
    node_modules/next
      peer next@">=13" from [email protected]
      node_modules/nextra
        dev nextra@"^3.3.1" from the root project
        nextra@"^3.3.1" from @doenet/[email protected]
        packages/docs-nextra
          @doenet/[email protected]
          node_modules/@doenet/docs-nextra
            workspace packages\docs-nextra from the root project
        peer nextra@"3.3.1" from [email protected]
        node_modules/nextra-theme-docs
          dev nextra-theme-docs@"^3.3.1" from the root project
          nextra-theme-docs@"^3.3.1" from @doenet/[email protected]
          packages/docs-nextra
            @doenet/[email protected]
            node_modules/@doenet/docs-nextra
              workspace packages\docs-nextra from the root project
      peer next@">=13" from [email protected]
      node_modules/nextra-theme-docs
        dev nextra-theme-docs@"^3.3.1" from the root project
        nextra-theme-docs@"^3.3.1" from @doenet/[email protected]
        packages/docs-nextra
          @doenet/[email protected]
          node_modules/@doenet/docs-nextra
            workspace packages\docs-nextra from the root project
    peer react-dom@">=18" from [email protected]
    node_modules/nextra-theme-docs
      dev nextra-theme-docs@"^3.3.1" from the root project
      nextra-theme-docs@"^3.3.1" from @doenet/[email protected]
      packages/docs-nextra
        @doenet/[email protected]
        node_modules/@doenet/docs-nextra
          workspace packages\docs-nextra from the root project
    peer react-dom@">=16.14.0" from [email protected]
    node_modules/react-bootstrap
      dev react-bootstrap@"^2.10.9" from the root project
  peer react@">=16.3" from @fortawesome/[email protected]
  node_modules/@fortawesome/react-fontawesome
    dev @fortawesome/react-fontawesome@"^0.2.2" from the root project
    @fortawesome/react-fontawesome@"^0.2.2" from @doenet/[email protected]
    packages/doenetml
      @doenet/[email protected]
      node_modules/@doenet/doenetml
        workspace packages\doenetml from the root project
    @fortawesome/react-fontawesome@"^0.2.2" from @doenet/virtual-keyboard@*
    packages/virtual-keyboard
      @doenet/virtual-keyboard@*
      node_modules/@doenet/virtual-keyboard
        workspace packages\virtual-keyboard from the root project
  peerOptional react@"^16.9.0 || ^17.0.0 || ^18 || ^19" from @reduxjs/[email protected]
  node_modules/@reduxjs/toolkit
    dev @reduxjs/toolkit@"^2.6.1" from the root project
  peer react@">=16.8.0" from @uiw/[email protected]
  node_modules/@uiw/react-codemirror
    dev @uiw/react-codemirror@"^4.23.10" from the root project
  peer react@">=18" from [email protected]
  node_modules/nextra
    dev nextra@"^3.3.1" from the root project
    nextra@"^3.3.1" from @doenet/[email protected]
    packages/docs-nextra
      @doenet/[email protected]
      node_modules/@doenet/docs-nextra
        workspace packages\docs-nextra from the root project
    peer nextra@"3.3.1" from [email protected]
    node_modules/nextra-theme-docs
      dev nextra-theme-docs@"^3.3.1" from the root project
      nextra-theme-docs@"^3.3.1" from @doenet/[email protected]
      packages/docs-nextra
        @doenet/[email protected]
        node_modules/@doenet/docs-nextra
          workspace packages\docs-nextra from the root project
  peer react@"^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0" from [email protected]
  node_modules/next
    peer next@">=13" from [email protected]
    node_modules/nextra
      dev nextra@"^3.3.1" from the root project
      nextra@"^3.3.1" from @doenet/[email protected]
      packages/docs-nextra
        @doenet/[email protected]
        node_modules/@doenet/docs-nextra
          workspace packages\docs-nextra from the root project
      peer nextra@"3.3.1" from [email protected]
      node_modules/nextra-theme-docs
        dev nextra-theme-docs@"^3.3.1" from the root project
        nextra-theme-docs@"^3.3.1" from @doenet/[email protected]
        packages/docs-nextra
          @doenet/[email protected]
          node_modules/@doenet/docs-nextra
            workspace packages\docs-nextra from the root project
    peer next@">=13" from [email protected]
    node_modules/nextra-theme-docs
      dev nextra-theme-docs@"^3.3.1" from the root project
      nextra-theme-docs@"^3.3.1" from @doenet/[email protected]
      packages/docs-nextra
        @doenet/[email protected]
        node_modules/@doenet/docs-nextra
          workspace packages\docs-nextra from the root project
  peer react@">=18" from [email protected]
  node_modules/nextra-theme-docs
    dev nextra-theme-docs@"^3.3.1" from the root project
    nextra-theme-docs@"^3.3.1" from @doenet/[email protected]
    packages/docs-nextra
      @doenet/[email protected]
      node_modules/@doenet/docs-nextra
        workspace packages\docs-nextra from the root project
  peer react@">=16.14.0" from [email protected]
  node_modules/react-bootstrap
    dev react-bootstrap@"^2.10.9" from the root project
  peer react@"*" from [email protected]
  node_modules/react-icons
    dev react-icons@"^5.5.0" from the root project
    react-icons@"^5.5.0" from @doenet/[email protected]
    packages/doenetml
      @doenet/[email protected]
      node_modules/@doenet/doenetml
        workspace packages\doenetml from the root project
    react-icons@"^5.5.0" from @doenet/virtual-keyboard@*
    packages/virtual-keyboard
      @doenet/virtual-keyboard@*
      node_modules/@doenet/virtual-keyboard
        workspace packages\virtual-keyboard from the root project

Could not resolve dependency:
dev react-reconciler@"^0.29.2" from the root project

Conflicting peer dependency: [email protected]
node_modules/react
  peer react@"^18.3.1" from [email protected]
  node_modules/react-reconciler
    dev react-reconciler@"^0.29.2" from the root project

@siefkenj
Copy link
Contributor

siefkenj commented May 2, 2025

I'm confused why react-dom needed to be added. Did npm install not work?

@bjones1
Copy link
Author

bjones1 commented May 2, 2025

I'm confused why react-dom needed to be added. Did npm install not work?

On Windows: npm install works, but npm run build fails, since the existing package-lock.json file doesn't have win32 wasm toold installed. npm update then fails with the error above, without this additional dependency. With this depedancy, npm update then npm run build now succeeds.

On Linux: npm install then npm run build works, but npm run dev fails (but this looks like a separate issue).

@siefkenj
Copy link
Contributor

siefkenj commented May 2, 2025

Are you able to develop on Linux/WSL? There are several other build scripts that assume a unix-like environment. I think supporting a windows dev environment will be a lot more trouble than its worth...

@bjones1
Copy link
Author

bjones1 commented May 2, 2025

Yes, I run WSL also. However, I'd suggest gradually merging changes that don't impact Linux/OS X while allowing pieces of Windows to work. I think a long-term goal of Windows support would enlarge the pool of potential project contributors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants