nx: imports of lazy-loaded libraries are forbidden due to name collision

I have a lib called ‘order’, which is lazy-loaded, and a lib called ‘oder-api’, which isn’t lazy loaded.

TSLint gives me the following error on a import of the OrderApiModule (from ‘order-api’). [tslint] imports of lazy-loaded libraries are forbidden (nx-enforce-module-boundaries)

As far as I could figure out there is some name collision with the ‘order’ lib, because if I rename the ‘order-api’ libs folder to something like ‘apiorder’, the error is not displayed anymore. For renaming it ‘orderapi’ (without dash) I also get the error.

Version info: "@nrwl/nx": "0.7.4", "tslint": "5.9.1",

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (10 by maintainers)

Most upvoted comments

@FallenRiteMonk great to hear!

I try to add some tests, I hope the pr will get merged then …

with allow you can set a list of import paths that are allowed no matter where you import from it (eg. allow: ["../../libs/mylib/some.component", "../../libs/my-other-lib/other.component"]). it is a white list of allowed import paths.

allowing globs here would be nice, but at the moment it has to match exactly…

@ThomasBurleson event with 0.8.0 I get the same error message.

Furthermore I noticed that by installing 0.8.0 one gets the following message displayed:

 postinstall <PROJECT_PATH>
> nx migrate check

-----------------------------------------------------------------------------
-------------------------------IMPORTANT!!!----------------------------------
-----------------------------------------------------------------------------
Run "npm run update" to run the following migrations:
- 20180225-switch-to-cli17
Switch to Angular CLI 1.7
-----------------------------------------------------------------------------
- 20180227-cleanup-scripts
Add update, update:skip, update:check scripts
-----------------------------------------------------------------------------
Or run "npm run update:skip" to set the latestMigration property
in .angular-cli.json to: "20180227-cleanup-scripts".
npm WARN ngrx-undo@4.0.2 requires a peer of @ngrx/store@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

updated 2 packages in 17.257s

This is a bit misleading because one hast to run npm run nx-migrate first, so that the ‘nx-migrate’ script gets renamed to ‘update’.