question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Type <typename> in <path> is part of the declaration of 2 modules...

See original GitHub issue

Hi, I got this error after loading tsconfig.app.json.

image

{
	"extends": "../tsconfig.json",
	"angularCompilerOptions": {
		"paths": {
			"eyc-sol-ant-pln": [ "../my-lib/src/public_api.ts" ]
		}
	},
	"compilerOptions": {
		"outDir": "../out-tsc/app",
		"module": "es2015",
		"baseUrl": "",
		"types": [],
		"paths": {
			"eyc-sol-ant-pln": [ "../my-lib/src/public_api.ts" ]
		}
	},
	"exclude": [ "test.ts", "**/*.spec.ts", "**/*.mock.ts" ]
}

I don’t really think, the module is declared in two modules, it is only declared in CoreModule:

image

Isn’t it the problem with paths (/ vs \, I’m on Win10)?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
risciecommented, Feb 23, 2018

@mgechev that does not cut it for me, I get the same error with or without exclude / include properties.

1reaction
augustincalincommented, Mar 2, 2018

Actually, reproducing this is quite simple (Windows 10).

ng --version

Angular CLI: 1.6.7 Node: 8.9.4 OS: win32 x64 Angular: 5.2.7 … animations, common, compiler, compiler-cli, core, forms … http, language-service, platform-browser … platform-browser-dynamic, router

@angular/cli: 1.6.7 @angular-devkit/build-optimizer: 0.0.42 @angular-devkit/core: 0.0.29 @angular-devkit/schematics: 0.0.52 @ngtools/json-schema: 1.1.0 @ngtools/webpack: 1.9.7 @schematics/angular: 0.1.17 typescript: 2.5.3 webpack: 3.10.0

  1. create new angular cli project: ng new ng-rev
  2. cd ng-rev
  3. generate a module: ng g m ModuleOne
  4. add a component in this module: cd src\app\module-one\ and then ng g c ComponentOne.
  5. export ComponentOneComponent from module-one.module.ts: exports: [ComponentOneComponent]
  6. add ModuleOneModule in app.module.ts imports: imports: [BrowserModule, ModuleOneModule]
  7. Try to open the project in ngrev. You will see the error.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Component is part of the declaration of 2 modules
I understand that I have to remove one of the declarations, but I don't know how. If I remove the declaration from AppModule...
Read more >
Module types (module specifications)
Module types are the module-level equivalent of type expressions: they specify the general shape and type properties of modules. module-type, ::= modtype-path.
Read more >
Chapter 7. Packages and Modules - Oracle Help Center
A type -import-on-demand declaration (§7.5.2) imports all the accessible types of a named type or named package as needed, by mentioning the canonical...
Read more >
References to Values - Configuration Language | Terraform
<RESOURCE TYPE>.<NAME> represents a managed resource of the given type and name. The value of a resource reference can vary, depending on whether...
Read more >
psddl.HddlReader — pydoc-all documentation
EDU $ # # Description: # Module HddlReader. ... Type import Type from psddl. ... parseDevelTypes: return # every type must have a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found