-
Notifications
You must be signed in to change notification settings - Fork 63
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 find name 'console'. (only server side) #246
Comments
Originally asked on Stack Overflow. |
I get the same error with FileReader, both on the client and server. It seems to not know javascript library names. The code works just fine, these errors are in the build process. |
You will need to install NodeJS typings, i.e, |
@barbatus thanks, I just tried |
didn't work for me, either. |
Also didn't work from me, I think it must have something to do with the barbatus:typescript library and how it addresses typings -- see that stack overflow post @hongbo-miao linked to. |
Also to note, it seems if we eagerly load code (put in /client and /server folders), the console log warnings from the typescript compiler go away for us. It's only when we lazily load (put everything in the imports directory, as recommended by the Meteor 1.3 meteor guide), that we actually get these warnings. That makes me think it has something to do with packaging with meteor and what's happening converting the typescript into JS. It feels like the lazily loaded case is missing some stuff, specifically the typings as defined in that stack overflow post above, specifically: https://basarat.gitbooks.io/typescript/content/docs/types/lib.d.ts.html |
@denodaeus Maybe it's something different, but I've been seeing this issue with code in a /server folder as well:
|
Just throwing it out here, you can make this temporarily go away (the typescript compiler warnings) by throwing this into a custom typing .d.ts:
or just declare the var inside your class files. A work around if you want the warnings to go away, but hopefully these guys get to the root cause of the problem. |
Installing node@4.0.0 (DefinitelyTyped)... Seemed to get rid of the errors on the browser part of the build, but the server still gives errors. |
The issue is in that TypeScript package uses So, I just created a meteor typings repo https://github.com/barbatus/meteor-typings with more or less right structure, which will be hopefully added to the
|
Not using Angular but React and it perfectly works too thx to @barbatus file. |
It's added to the registry. Install by: |
@barbatus Is there a reason to create a separate meteor typings repo? There was some work done here: https://github.com/meteor-typescript/meteor-typescript-libs That also includes typings for a lot of the meteor modules that we would use (for example: aldeed:simple-schema) |
I am using Angular2-Meteor, TypeScript. (Meteor version 1.3.2.4)
When I use
console.log('test');
on the server side, it is working well.However, I got this warning in my terminal:
The code for server side is very simple:
I made a reproduction for this issue here.
The text was updated successfully, but these errors were encountered: