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
missing isBrowser function in util package triggers an exception #84
Comments
Thank you for your report. Could you provide more details about your code and environment? I can use 1.10.0 and a simple script to create, list, get, put, and delete objects and buckets without seeing this exception. |
@IBMeric basically we instantiate the SDK like this:
On the instance we then call
Our environment is a React microservice that runs on a Node 14.16.0 runtime. The code from above is part of the client-side code of the UI microservice. Not sure whether this helps answering your question. I am also available on IBM Slack, feel free to reach out. |
@IBMeric - any updates? I've hit the same issue while upgrading from Some changes in this diff must cause the problem Our code fails in this line (running in a browser environment) because AWS.util.isBrowser is not a function Line 115 in b86487e
The stack trace that lead to the invocation of this line is below
Below lines were removed in the referenced diff and at least look suspicious: Lines 38 to 39 in 9bec920
Is there anything else you need to drive this forward? |
This seems to be an interaction issue with the way the SDK is being used. When using For reference: https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-node#node-examples-init |
I created a new project from scratch for test purposes and am unable to reproduce the exception (the previous reproduction turned out to be an unrelated problem). Could you provide additional details on differences between this sample code and your project? Since I cannot reproduce the problem in pure Javascript, are you using a dialect? Which one?
main.js
package.json
|
@IBMeric the most obvious difference from your test code and the snippet shared by @modean is that you tested with I can try to work on a small reproducer next week but first I'd like to understand if you were able to run an upload and could verify that the code successfully passed this line Line 115 in b86487e
If so, can you add a breakpoint in there and share what properties are set on |
@daka1510 Perhaps see #83. There is no difference when I use
...
|
I added a breakpoint at the line you requested. I truncated multiline output (it's over 200 lines), but you will see the two functions of interest are there.
|
@IBMeric - I created a small repository with code that allows to reproduce the problem in isolation. See https://github.com/daka1510/ibm-cos-sdk-issue-reproducer#reproducer-for-httpsgithubcomibmibm-cos-sdk-jsissues84 for details. Most of the code is generated by https://reactjs.org/docs/create-a-new-react-app.html#create-react-app. The second commit adds what is needed to reproduce the problem. Can you give it a try? |
Thank you for the project. I have been able to reproduce the issue in Firefox 88. The problem appears to be an interaction with React that could also apply to other frameworks. I need to discuss this internally and have opened a tracking ticket. |
@rrodriguez06 isn't this exactly the line that was removed and thus did cause the breakage? |
For those who are still experiencing this issue, here is an hotfix of the problem.
it's a bit tricky ! |
Sorry for a delayed response. I've tested a resolution against @daka1510's project. I no longer see output in the browser console. The plan is to publish this fix in the next point release. Currently there are some other fixes we are working on. If those appear to require too much time, we'll do a separate update for this fix. |
@IBMeric - can you share a rough release timeline for this fix? |
The release will either be this week or early next week. |
Closing this issue as resolved. |
@IBMeric I verified the published version 1.10.1 locally and it seems to be working. |
Since
"ibm-cos-sdk": "1.10.0",
theisBrowser
function seems to be missing inmaster/lib/util.js
. Thus the following exception will be thrown if using the SDK.The text was updated successfully, but these errors were encountered: