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

Cannot read property 'crypto' of undefined #386

Closed
xiaoyuhen opened this issue Mar 14, 2018 · 2 comments · Fixed by #390
Closed

Cannot read property 'crypto' of undefined #386

xiaoyuhen opened this issue Mar 14, 2018 · 2 comments · Fixed by #390

Comments

@xiaoyuhen
Copy link

直接引用 dist/aliyun-oss-sdk 会报 Cannot read property 'crypto' of undefined

引用源码不会出问题。尝试把 aliyun-oss-sdk 里的
https://github.com/ali-sdk/ali-oss/blob/master/dist/aliyun-oss-sdk.js#L8742
改为 var _global = this || window || {}可以解决问题。

看起来是引用的 crypto-browserify@ 1.0.9 造成的

@PeterRao
Copy link
Collaborator

嗯,确实是crypto-browserify出的问题,引用源码应该webapck应该处理掉这个this了。我们处理下看crypto-browserify这个能否升级或者替换。

binghaiwang added a commit to binghaiwang/ali-oss that referenced this issue Mar 19, 2018
@WiFiUncle
Copy link

同问。加载sdk源码没问题。但是babel编译后,就报
aliyun-oss-sdk.js:837 Uncaught TypeError: Cannot read property 'crypto' of undefined

oss.js:14 Uncaught TypeError: Cannot read property 'Wrapper' of undefined
at oss.js:14

binghaiwang added a commit to binghaiwang/ali-oss that referenced this issue Mar 21, 2018
PeterRao pushed a commit that referenced this issue Mar 21, 2018
popomore added a commit that referenced this issue Apr 3, 2018
This reverts commit 5b5ae3e.
popomore added a commit that referenced this issue Apr 3, 2018
* Revert "Create ISSUE_TEMPLATE.md"

This reverts commit 53c024a.

* Revert "chroe: build 4.14.1"

This reverts commit 18f2f5e.

* Revert "chore(release): 4.14.1"

This reverts commit d3f6b13.

* Revert "fix: signUtils header sort err fix (#418)"

This reverts commit 60383ee.

* Revert "chore: bump 4.14.0"

This reverts commit a617866.

* Revert "chore(release): 4.14.0"

This reverts commit 4d3e7fe.

* Revert "chore: remove the temp file"

This reverts commit b9a2cec.

* Revert "fix: _resumeMultipart not use yield"

This reverts commit ba2382b.

* Revert "fix(Browser): multipartUpload InvalidPartOrderError by doneParts repeat (#414)"

This reverts commit 2b0967f.

* Revert "feat: browser support blob (#409)"

This reverts commit e8a78b5.

* Revert "feat(browser): multipartUpload err will cancel this task (#399)"

This reverts commit 64f8d68.

* Revert "feat: signatureUrl refactor and support callback (#408)"

This reverts commit 343938f.

* Revert "chore: Delete example build file (#410)"

This reverts commit 02b0efd.

* Revert "feat: rm unused test data (#401)"

This reverts commit 3d2ce4e.

* Revert "feat: add ignore (#397)"

This reverts commit 0f003aa.

* Revert "refactor: add eslint for es6 (#382)"

This reverts commit e3c1b54.

* Revert "fix: issues #386 (#390)"

This reverts commit 5b5ae3e.

* Revert "refactor: authorization refactor (#387)"

This reverts commit 59e245e.

* Revert "feat: expose sdk version with OSS (#389)"

This reverts commit 0bdc876.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants