UnityRenderStreaming icon indicating copy to clipboard operation
UnityRenderStreaming copied to clipboard

[BUG]: WebApp dependency is incorrectly placed in devDependencies

Open gpiffaretti opened this issue 3 years ago • 5 comments

Package version

3.1.0-exp.3

Environment

When deploying the WebApp to a server like Heroku or Google Cloud, these platforms install dependencies but ignore devDependencies, which make total sense. When this happens the app crashes on start because it can't find 'commander'. When looking at who depends on this package:

[email protected] $user\Projects\WebApp
`-- [email protected]
  +-- [email protected]
  `-- [email protected]
    `-- [email protected]

'newman' is right now included as a devDependency and should be moved to 'dependencies'.

Steps To Reproduce

I don't know exactly how Google Cloud or Heroku setup applications internally, so here's what I'm doing to run the app without dev dependencies:

  • Clone repo.
  • Navigate to WebApp.
  • npm install #(this will install both dev and prod dependencies)
  • npm run build #(use dev dependencies to generate build)
  • delete node_modules folder
  • Remove the 'prestart' and 'postinstall' commands from package.json. This is triggering a npm install and it will install dev dependencies again, which we are trying to avoid.
  • npm install --only=prod #(make sure we don't install dev dependencies)
  • npm start

And the result is: Error: Cannot find module 'commander'

Because this is included through newman dependencies, and should be included as a dependency for this package directly.

Current Behavior

No response

Expected Behavior

No response

Anything else?

No response

gpiffaretti avatar Mar 14 '22 22:03 gpiffaretti

@gpiffaretti newman package is used for only testing APIs. Could you tell me how do we reproduce your issue?

karasusan avatar Mar 15 '22 02:03 karasusan

Ok then 'commander' should be included as a dependency. It's used in index.js:

image

But when running things locally, this package is present because it's included through newman.

I'll update reproduce steps in the issue.

gpiffaretti avatar Mar 15 '22 15:03 gpiffaretti

BTW, with this fix and some minor adaptations for Heroku, I was able to deploy the app successfully.

gpiffaretti avatar Mar 15 '22 15:03 gpiffaretti

@gpiffaretti OK, all right. we should fix the package.json to add dependencies commander package. Thanks for your advice.

karasusan avatar Mar 23 '22 02:03 karasusan

memo: URS-433

karasusan avatar Apr 12 '22 02:04 karasusan