-
Notifications
You must be signed in to change notification settings - Fork 26
Ambient global namespace not found #18
Comments
Hi @kuon, Sorry the waiting. If you have always the problem, I can take few minutes to check that this issue is not thrown by brunch-typescript. |
I'm having the same problem. But only with some of the uses which is weird. |
Just ignoring the error seemed to work for me. plugins: {
brunchTypescript: {
ignoreErrors: [
2503 // Cannot find namespace {0}
]
}
} |
Sorry, I should have chimed in earlier. This plugin runs TypeScript in a single file isolation mode. That means that it looks at each file without any outside context. It makes it faster, but it is also a lot less "intelligent". When we started surfacing errors, it was obvious that many of the errors were because of this mode. Finding outside namespaces is obviously one such error. We can add it to the list which are ignored by default which will help in this case. I had started looking into an option to run the full typescript language server as part of compilation (perhaps when doing a regular build without watching). I didn't get very far with that. If you are using this plugin, I recommend adding |
Ah that's why |
@colinbate Can you improve brunch-typescript in any way ? |
@baptistedonaux I think it would require using the typescript service. When I was using browserify, I was using https://github.com/TypeStrong/tsify which uses the typescript services. |
I am trying to use the youtube definition file https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/youtube/youtube.d.ts
This file is referenced from my
app.ts
file with/// <reference path="youtube.d.ts" />
.I can compile my
app.ts
file withtsc -m commonjs
, but with brunch, I got:Error 2503: Cannot find namespace 'YT'. (Line: 104, Col: 28)
If I copy the content of the
youtube.d.ts
file in myapp.ts
brunch can then compile it.Any idea?
The text was updated successfully, but these errors were encountered: