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.

ng test doesn't support index.ts imports

See original GitHub issue

Which @angular/* package(s) are the source of the bug?

Don’t known / other

Is this a regression?

No

Description

Hello, ng test fails when there are folder imports that use index.ts file. On the other side, ng build works ok.

Please provide a link to a minimal reproduction of the bug

https://github.com/lukasmatta/angular-index-import

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 14.0.2
Node: 16.13.1
Package Manager: npm 8.12.2
OS: darwin x64

Angular: 14.0.2
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1400.2
@angular-devkit/build-angular   14.0.2
@angular-devkit/core            14.0.2
@angular-devkit/schematics      14.0.2
@schematics/angular             14.0.2
rxjs                            7.5.5
typescript                      4.7.4

Anything else?

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
JoostKcommented, Jun 22, 2022

That is most likely due to a cycle in your code:

>  ./node_modules/.bin/ngc -p tsconfig.app.json
> npx madge --circular out-tsc/app/main.js
Processed 12 files (268ms) (3 warnings)

✖ Found 1 circular dependency!

1) app/ads/ad-banner.component.js > app/ads/index.js
0reactions
angular-automatic-lock-bot[bot]commented, Jul 23, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ng test fails Module not found: Error: Can't resolve 'fs' #8357
I had the same error after running ng test that went away after removing import 'jasmine'; from *.spec.ts files.
Read more >
@angular/material/index.d.ts' is not a module - Stack Overflow
I have a material.module.ts file that I import / export all the material ... not used by my modules, but it doesn't seem...
Read more >
Launching your app with a root module - Angular
When you use the Angular CLI command ng new to generate an app, the default AppModule looks like the following: content_copy /* JavaScript...
Read more >
The Best Way To Architect Your Angular Libraries
ts will be used to export all the entities (like modules, components, services or directives) that belong to the particular sub-entry. Currently we...
Read more >
Configuring Jest
To read TypeScript configuration files Jest requires ts-node . ... This option tells Jest that all imported modules in your tests should be ......
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