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.

ESLint: ENOENT: no such file or directory when referencing the secondary entry point

See original GitHub issue

Hi,

i have structure like this:

/libA                        
  /src
    /liba.module.ts
 /core
   /src
     /lib
        /models.ts
  • LibA is primary entry point
  • Core is secondary entry point

Everything is generated by NX schematics - @nrwl/angular:library and @nrwl/angular:library-secondary-entry-point so all files are generated correctly.

However, i would like to import models.ts and use it in libA.module.ts. But there is a problem…

When i import by generated path: import { Something } from "@libA/core";

I got:

Error: ENOENT: no such file or directory, open 'libs/libsA/src/index.ts'
Occurred while linting ....
Rule: "@nrwl/nx/enforce-module-boundaries"

But everything is building fine


. When i change to relative path: import { Something } from "../../core/src";

Lint error is gone, however i cannot build, because “is not under ‘rootDir’” error.

How should we import Secondary-entry-point files withing primary-entry-point files ? (under liba/src/lib) ?

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:10
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
Samuel-Beslogiccommented, Sep 28, 2022

@nrwl/nx/enforce-module-boundaries crashes ESLint for me as well when there’s a relative import.

4reactions
meeroslavcommented, Oct 18, 2022

We will look into it as soon as possible. Sorry to keep you all waiting.

Read more comments on GitHub >

github_iconTop Results From Across the Web

File exists, but `ENOENT: no such file or directory...` reported.
This file existed in different branch. Workaround: delete repo where issue appears, create new folder with new path, clone repo. I've tried to ......
Read more >
Solving the 'npm WARN saveError ENOENT: no such file or ...
First you will make your project directory. This is just an empty new directory. Let's call it ts . From inside the ts...
Read more >
Configuring Jest
To read TypeScript configuration files Jest requires ts-node . ... The directory where Jest should store its cached dependency information.
Read more >
How to Create and Publish a React Component Library
The entrypoint for our library (input) is the index.ts file in the src directory ... file: Error ENOENT: no such file or directory,...
Read more >
Changelog | skuba - GitHub Pages
This release contains some breaking changes to the Lambda runtime such as the removal of AWS SDK V2 in favour of AWS SDK...
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