-
Notifications
You must be signed in to change notification settings - Fork 14
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
Change how version string is loaded from package.json #21
Conversation
@mbish - This seems to have worked for me. |
Hi @mbish . Do you need anything else from me? Any further testing? Be happy to help. |
Thanks very much for being willing to test this. Have you tested the update to |
Hi - I will take the latest copy and test this today. Thank you, |
I'll merge this and if @rfossella runs into problems we can do a second PR. |
Hi. So I did a clean uninstall of @duosecurity/duo_universal and then did fresh install v2.0.2. I am now running into the same problem where the package.json file cannot be read in constants.js. I verified this on two separate boxes after fresh install of 2.0.2 The examples package still works as it always did. Did nothing out of the ordinary, AFAIK, just added it to my package.json and npm install. Also as a stand-alone install command of package. Am I missing any step(s)? |
Good news. The latest fix from package-json-fix2 seems to have worked for me. Can we complete a new npm version? |
Hi - any more updates w/this? DUO deadline is March 31, 2024? |
Load package.json using
require
rather than a file read operationDescription
Issue #5 identified that the way this library loads its version data from
package.json
willlead to either the wrong version string being put into the user-agent string or a node error
depending on which
package.json
file is read.This PR remidies this issue by using
require
rather than a raw file read, meaning that pathswill be interpreted relative to the source file rather than from the node project root.
Motivation and Context
Issue #5, not breaking people using webpack and generally wanting to have accurate vesrion data in the user-agent string.
How Has This Been Tested?
I've tested this in a web-packed app but I also never got the error indicated in issue #5 so I'm
curious if this fixes the problems identified there.
Types of Changes