-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Typescript error: Cannot find name 'Buffer'/'http'/'https' #1271
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
@remimarenco I admit it's odd to have to include node typings for a front-end project, but can you try installing the environment typings to see if it gets around your issue? |
@chrisradek Thanks for you swift reply! I came across this recommendation on different websites, but unfortunately it does not change anything :/. Should I also include @types/aws-sdk? I had some issues with it that is why I did not add it yet. |
I found a work-around, I have to dig deeper to see if the issue is related to just In your |
Hi @chrisradek! A bit of feedback since I have followed your advice:
Thanks again! |
I have same problem. I am using angular-cli stable with Angular 4. |
@pvamshi |
@chrisradek Sure. Here is my config . It's exactly what we get with cli except for the above mentioned line. Thanks in advance.
Edit: package.json gist : https://gist.github.com/pvamshi/a2cb2c5bca99fe285ebddcabbb5f56f2 |
@pvamshi |
@pvamshi Based on these TypeScript docs:
Since |
This worked , thanks a lot . |
I had the same issue as @pvamshi. @chrisradek's solution |
It works for me, thanks a lot |
Updated tsconfig.app.json inside src folder, it works for me, thanks!
|
I also had to add
|
Thanks so much @chrisradek That worked for me |
Based on the last comments, it sounds like this issue is resolved: there are some Angular-specific hurdles to using the dependent Please let me know if I'm mistaken and there's something more the SDK should be doing here. |
I've just had the same issue within an angular 4.3.3 project. |
I confirm this has worked out and was managed to run the code! |
This worked for me as well. May I suggest, you could add this as an official step to take in the README.md. Based on the feedback here, it seems to help anyone adding aws-sdk to an angular-cli based project. |
I was able to make it work by taking out the types key in {
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"baseUrl": "./",
"module": "es2015"
},
"exclude": [
"test.ts",
"**/*.spec.ts"
]
} |
Worked for me the solution...! thanks |
After changing tsconfig.app.json, it worked for me. Changing tsconfig.json hasn't solved this issue. |
After changing tsconfig.app.json, it worked for me. Changing tsconfig.json hasn't solved this issue. [2] |
@danieladams456 solution worked for me. Seems like a bug in the SDK... |
Link for those coming here after the fact: https://github.com/aws/aws-sdk-js#with-angular |
Hey there, I'm adding the types to my tsconfig.json then it gives me another error:
Here's my tsconfig.json: {
"compilerOptions": {
"target": "es2015",
"module": "es2015",
"moduleResolution": "node",
"jsx": "react",
"outDir": "compiled",
"rootDir": "./src",
"types": ["node", "react", "react-native", "jest"]
},
"include": ["./src/**/*"],
"exclude": [
"./compiled",
"./node_modules"
]
} It seems that node types are conflicting with react-native. Any thoughts? cc @chrisradek |
thank you @chrisradek! |
thank you @chrisradek! |
It doesn't make any sense, but on Ionic you have to add this, even if it doesn't make sense. under compiler options
|
Found this while having the same/similar issues implementing awsmobile-cli and aws-amplify with angular5. Was receiving many webpack errors, followed the solutions in this order which solved my problem:
|
Hi @MissAnichka, did you have this error message: EDIT: fix is |
For anybody using the ionic framework, and wanting to use the aws-sdk with typings. Its a bit different than what explained above:
then you should be able to build |
Thanks @chrisradek |
This fixed it for me. Thanks @huangzhenhong ! |
Hello @chrisradek, thanks for the sdk and your replies on this thread. |
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. |
Hi!
First, I want to thank you for this SDK, it will be very useful for us!
I have some errors when building the javascript bundle for my application (React/Typescript/Webpack). It seems to work anyway (or maybe I have not used it enough yet), but I am not comfortable building our app with errors :).
Here is an extract of the errors:
And you can find the full errors on this gist => https://gist.github.com/remimarenco/c51c3170fbfd8d548e6fd2fe4542cdb1
I am also including my configuration files in the gist, in case they could be useful :). The architecture of my application is like this:
taiga/
package.json
package.json
tsconfig.json
webpack.config.js
Do you think you know what is not correct in my configuration? Or is it on the sdk side + webpack (and/or typescript)?
Thanks a lot!
The text was updated successfully, but these errors were encountered: