Angular Libraries: 'rootDir' is expected to contain all source files

Discussão em 'Angular' iniciado por Ezequiel MS, Janeiro 9, 2025.

  1. Ezequiel MS

    Ezequiel MS Guest

    A question, I don't know if this happens to anyone, I don't know how to fix it.

    From an entry point (a component) I want to import the model of the other, but I get the error:


    File is not under 'rootDir' 'packages'. 'rootDir' is expected to contain all source files
    ​

    For example, importing a material module that has all the modules inside is much more like it too, models that can be used in other components/entry-points of the angular lib, etc.

    How can I fix it? Does anyone know?

    I post photos of the structure

    (https://i.sstatic.net/Jp60TaJ2.png)

    (https://i.sstatic.net/F80XKrVo.png)

    (https://i.sstatic.net/fGHGSJ6t.png)

    I tried to solve it in several ways, but none of them worked for me

    I tried in tsconfig, angularjson, adding another angular, rootDir, exclude, include to the folders and nothing helped

    In fact I have only one project. Its an angular library with 2 entry points, but the tsconfig I configure is the tsconfig of the entire library.

    This is the structure:

    project
    --ngx-rydex
    ----dynamic-images
    -------models
    ---------buttonForm.ts
    -------index.ts
    -------ng-package
    -------publicapi
    ----recaptcha
    -------index.ts
    -------ng-package
    -------publicapi


    So, one model I have in dynamic-images component, I want to use in recaptcha component

    Continue reading...

Compartilhe esta Página