global.TYPED_ARRAY_SUPPORT is undefined for react-native
See original GitHub issueI get the above error on import AWS from 'aws-sdk/dist/aws-sdk-react-native
. Others have gotten when using babel-preset-env
instead of module:metro-react-native-babel-preset
"@babel/runtime": "^7.1.2",
"aws-sdk": "^2.198.0",
"buffer": "^5.2.1",
"@babel/plugin-transform-runtime": "^7.1.0",
"metro-react-native-babel-preset": "^0.48.2",
"react": "^16.6.0-alpha.8af6728",
"react-native": "^0.57.4",
I fixed it by editing node_modules/aws-sdk/dist/aws-sdk-react-native.js
and changing the below code to Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport()
.
// https://i.imgur.com/xyjLBOl.jpg
Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
? global.TYPED_ARRAY_SUPPORT
: typedArraySupport()
I believe this is a problem with babel
polyfilling global
and is maybe related to webpack
.
More in depth troubleshooting at https://github.com/aws-amplify/amplify-js/issues/803 and https://github.com/aws-amplify/amplify-js/issues/2005
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
How to force TYPED_ARRAY_SUPPORT in buffer to false for ...
Simply put global.Buffer.TYPED_ARRAY_SUPPORT = false; in global.js and shim in your global.js as early in the app as possible to ensure it ...
Read more >A brand new website interface for an even better experience!
global.TYPED_ARRAY_SUPPORT is undefined for react-native.
Read more >How to fix the ReferenceError: global is not defined error in ...
I spent hours trying to figure this out and it was really difficult to find the exact information on the web since this...
Read more >React Native Support in the AWS SDK for JavaScript
You can now access all services that are currently supported in the AWS SDK for JavaScript from within a React Native application.
Read more >Babel - Cannot read property 'TYPED_ARRAY_SUPPORT' of ...
Coding example for the question Babel - Cannot read property 'TYPED_ARRAY_SUPPORT' of undefined-babel.js.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for following up. I’ll close out this issue for now. If it reoccurs, let us know and we can re-open the issue.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.