If import paths are relative to application root, such imports are not recognized. i.e. like this:
import { MyComponentsModule } from "app/my-components/my-components.module";
Errors like these will be shown in templates:
'my-input' is not a known element:
- If 'my-input' is an Angular component, then verify that it is part of this module.
- If 'my-input' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
Instead, if imports are relative to current file, then those are recognized, e.g. this will have no problems:
import { MyComponentsModule } from "../my-components/my-components.module";
@tx8821 Thank you for this. This does work but I wouldn't necessarily call it a fix. Relative paths get very messy/ugly especially when moving files around.
Good to know, since some days I have the same issue. But I agree, this is not a solution
I've been having the same issue and tracked it down to this extension. Our app has grown to the point where relative paths are breaking as we refactor and we want to start using non-relative paths wherever appropriate without listing Problems inside in the IDE about code that meets the TypeScript spec, compiles, and runs as expected.
THANK YOU I was wondering where this error was comming from had it narrowed down to this plug. I noticed I got an error for the component when the path wasn't relative when importing into compnents So I guess this makes sense.
Fixed in 0.1.4
Thank you!
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
Good to know, since some days I have the same issue. But I agree, this is not a solution