twilio / twilio-video-app-react

A collaboration application built with the twilio-video.js SDK and React.js
Apache License 2.0
1.81k stars 728 forks source link

`react-spring` is not installed #612

Closed viglucci closed 2 years ago

viglucci commented 2 years ago

Describe the bug

Building the application fails due to missing react-spring dependency.

To Reproduce

1) Fresh clone the repository 2) Install dependencies with npm install 3) Run npm run build

Expected Behavior

A production-ready build is produced.

Actual Behavior

$ npm run build

> twilio-video-app-react@0.6.0 build C:\dev\kevin\twilio-video-app-react
> node ./scripts/build.js

Creating an optimized production build...
Failed to compile.

.\node_modules\@visx\xychart\esm\components\annotation\AnimatedAnnotation.js
Cannot find module: 'react-spring'. Make sure this package is installed.

You can install this package by running: npm install react-spring.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! twilio-video-app-react@0.6.0 build: `node ./scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the twilio-video-app-react@0.6.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Environment (please complete the following information):

Additional context

n/a

olipyskoty commented 2 years ago

Hey @viglucci thanks for reaching out!

I can confirm that I can reproduce this. I was able to work around this by running npm i react-spring, but I am curious as to why this error is happening now 🤔 .

I am going to investigate this a little further to try and find out why we are seeing this issue. I will report back with my findings!

timmydoza commented 2 years ago

Thanks for the issue @viglucci!

This one can be solved by upgrading NPM to version 7 before you run NPM install. npm install -g npm should do the trick.

The problem with NPM version 6, is that is doesn't understand the package-lock.json file in this repository, which is a version 2 package lock file. NPM version 7 will correctly abide by this version 2 lockfile, which will result in react-spring being installed.

That said, this all stems from our twilio-video-room-monitor library, which uses @airbnb/visx as a dependency, and this dependency requires react-spring as a peer dependency. We're planning on updating the room monitor to include react-spring as dependency to avoid this problem down the road.

viglucci commented 2 years ago

Thanks for the update @timmydoza .

I might suggest setting the engines property in the package.json, which should warn users in situations like this. I briefly checked the package.json and it doesn't appear to be set currently.

joytalentless commented 1 year ago

Thanks for the update @timmydoza .

Is there any choice to fix this issue without updating npm version?