-
Notifications
You must be signed in to change notification settings - Fork 12k
Typsecript non-relative module resolution skipping root folder in hierarchy for @types #9745
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
Comments
|
@clydin That explains the tsc/WebStorm parts of this. I can work around this issue by adding the following to the end of import { IAngularStatic } from "angular";
declare var angular: IAngularStatic;
angular.module('test')
.factory('testService', downgradeInjectable(TestService)); This seems to work fine. |
Yes. That works because type only imports are removed during transpilation as they provide no actual functionality in the final output. I'm going to close this as resolved. |
Sorry but I don't know if I would mark this as closed entirely. A lot of this is probably misunderstanding on my part, but also is possibly a lack of documentation.
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Versions
Repro steps
ng new test-app
npm install @types\angular
test-app\src\app\app.module.ts
to add the followingng build --verbose
Observed behavior
The build fails with the following report
Desired behavior
The build succeeds.
Mention any other details that might be useful (optional)
I'm building a AngularJS Hybrid app, and cant seem to be able to resolve @types packages correctly.
If you look at the error above, you see the following when it tries to resolve the
import * as angular from 'angular'
It seems to entirely skip the
D:\Projects\AngularDummy\test-app\node_modules
folder where it would actually find the @types its looking for.If I don't actually include the
import
statement I get aCannot find name 'angular'
error.Running
tsc
on it's own appears to be fine, and WebStorm appears to be auto completing fine, which indicates this might be an angular-cli issue?The text was updated successfully, but these errors were encountered: