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

Dev Environment: React 18 / material-ui Version Conflict #5862

Closed
timtim17 opened this issue Apr 1, 2024 · 3 comments · May be fixed by #5906
Closed

Dev Environment: React 18 / material-ui Version Conflict #5862

timtim17 opened this issue Apr 1, 2024 · 3 comments · May be fixed by #5906

Comments

@timtim17
Copy link

timtim17 commented Apr 1, 2024

Expected Behavior

While setting up a dev environment, vagrant up should work as expected and the service should come up.

Current Behavior

Running:

TBA_LOCAL_DOCKERFILE=true vagrant up

Encountering the following error:

[...]
    default: Now using node v18.20.0 (npm v10.5.0)
    default: Running npm install... this may take a while...
    default: npm ERR! code ERESOLVE
    default: npm ERR! ERESOLVE could not resolve
    default: npm ERR!
    default: npm ERR! While resolving: material-ui@0.20.2
    default: npm ERR! Found: react@18.2.0
    default: npm ERR! node_modules/react
    default: npm ERR!   react@"^18.2.0" from the root project
    default: npm ERR!   peer react@">=16.8.0" from @emotion/react@11.11.1
    default: npm ERR!   node_modules/@emotion/react
    default: npm ERR!     @emotion/react@"^11.8.1" from react-select@5.8.0
    default: npm ERR!     node_modules/react-select
    default: npm ERR!       react-select@"^5.8.0" from the root project
    default: npm ERR!   25 more (@emotion/use-insertion-effect-with-fallbacks, ...)
    default: npm ERR!
    default: npm ERR! Could not resolve dependency:
    default: npm ERR! peer react@"^15.4.0 || ^16.0.0" from material-ui@0.20.2
    default: npm ERR! node_modules/material-ui
    default: npm ERR!   material-ui@"^0.20.2" from the root project
    default: npm ERR!
    default: npm ERR! Conflicting peer dependency: react@16.14.0
    default: npm ERR! node_modules/react
    default: npm ERR!   peer react@"^15.4.0 || ^16.0.0" from material-ui@0.20.2
    default: npm ERR!   node_modules/material-ui
    default: npm ERR!     material-ui@"^0.20.2" from the root project
    default: npm ERR!
    default: npm ERR! Fix the upstream dependency conflict, or retry
    default: npm ERR! this command with --force or --legacy-peer-deps
    default: npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
    default: npm ERR!
    default: npm ERR!
    default: npm ERR! For a full report see:
    default: npm ERR! /root/.npm/_logs/2024-04-01T03_18_08_415Z-eresolve-report.txt
    default:
    default: npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2024-04-01T03_18_08_415Z-debug-0.log
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

Presumably because the node modules could not be installed, the service cannot start -- observing this when running ./ops/dev/host.sh:

==> default: Doing an initial rsync...
Now using node v18.20.0 (npm v10.5.0)

> tba-react@0.0.0 dev
> cross-env NODE_ENV=development webpack --watch

sh: 1: cross-env: not found

Possible Solution

Bump material-ui dependency to updated version (package seems to be deprecated in favor of @material-ui/core or bumped to v5+)

Steps to Reproduce (for bugs)

  1. Install Vagrant/Docker
  2. Execute TBA_LOCAL_DOCKERFILE=true vagrant up
  3. Observe npm error and the service does not start

Context

Can't successfully start a local dev environment.

Your Environment

  • Version used: py3 @ eda54f8
  • Environment name and version (e.g. Chrome 39, node.js 5.4):
aus@vice /code/the-blue-alliance ❯  node -v
v18.20.0
  • Operating System and version (desktop or mobile):
❯  neofetch --off
aus@vice.local
OS: macOS 14.3.1 23D60 arm64
Host: MacBookPro18,3
Kernel: 23.3.0
Uptime: 15 days, 6 hours, 15 mins
Packages: 286 (brew)
Shell: zsh 5.9
Resolution: 3024x1964
DE: Aqua
WM: Quartz Compositor
WM Theme: Orange (Dark)
Terminal: iTerm2
Terminal Font: FiraCodeNerdFontCompleteM-Retina 13
CPU: Apple M1 Pro
GPU: Apple M1 Pro
Memory: 6450MiB / 32768MiB
Locale: en_US.UTF-8
@dracco1993 dracco1993 mentioned this issue Apr 25, 2024
6 tasks
@fangeugene
Copy link
Member

This might be fixed by #5963?

@timtim17
Copy link
Author

It does seem like after pulling in the changes from #5963 my dev env is functional.

IMO (as someone with no familiarity or real stake in the project) #5906 seems like a valuable initiative to get things overall more up to date (e.g. material-ui -> @material-ui/core v4 -> @mui/material v5). However, that seems like a more involved effort, and the issue of being unable to spin up an environment to get unblocked seems fixed.

@fangeugene
Copy link
Member

I agree, we do have a lot of deps that would be great to update. Just wanted to unblock you here.

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 a pull request may close this issue.

2 participants