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

[BUG]: WebApp dependency is incorrectly placed in devDependencies #662

Open
gpiffaretti opened this issue Mar 14, 2022 · 5 comments
Open
Assignees
Labels
bug Something isn't working issued This means the ticket is already created on internal issue tracker

Comments

@gpiffaretti
Copy link

gpiffaretti commented Mar 14, 2022

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:

webserver@3.1.0 $user\Projects\WebApp
`-- newman@5.3.0
  +-- commander@7.2.0
  `-- postman-collection-transformer@4.1.3
    `-- commander@8.0.0

'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 gpiffaretti added the bug Something isn't working label Mar 14, 2022
@karasusan
Copy link
Collaborator

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

@gpiffaretti
Copy link
Author

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
Copy link
Author

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

@gpiffaretti gpiffaretti changed the title [BUG]: WebApp dependency is in incorrectly placed in devDependencies [BUG]: WebApp dependency is incorrectly placed in devDependencies Mar 15, 2022
@karasusan
Copy link
Collaborator

karasusan commented Mar 23, 2022

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

@karasusan
Copy link
Collaborator

memo: URS-433

@karasusan karasusan added the issued This means the ticket is already created on internal issue tracker label Apr 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working issued This means the ticket is already created on internal issue tracker
Projects
None yet
Development

No branches or pull requests

2 participants