Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular - No app.module.ts file found. #5

Open
davisriska opened this issue Jul 5, 2022 · 0 comments
Open

Angular - No app.module.ts file found. #5

davisriska opened this issue Jul 5, 2022 · 0 comments

Comments

@davisriska
Copy link

davisriska commented Jul 5, 2022

When setting up a project with mobiscroll-cli, I received an error -

No app.module.ts file found. You are probably running this command in a non Angular-cli based application. 

I think the issue is that at this line -

if (!utils.importModules(path.resolve(currDir + '/src/app/app.module.ts'), 'app.module.ts', settings.jsFileName)) {
you are not checking angular.json for source root directory.
I got around this issue by just doing the imports myself, but it would be a nice feature if you could support sourceRoot property as the directory where you check for app/app.module.ts.

A snippet of angular.json

{
    "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
    "version": 1,
    "newProjectRoot": "resources",
    "projects": {
        "frontend": {
            "projectType": "application",
            "schematics": {
                "@schematics/angular:component": {
                    "style": "scss"
                },
                "@schematics/angular:application": {
                    "strict": true
                }
            },
            "root": "resources/frontend",
            "sourceRoot": "resources/frontend/src",
      ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant