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

Not able to find app.module.ts #450

Closed
vinayg-cp opened this issue Sep 19, 2018 · 5 comments
Closed

Not able to find app.module.ts #450

vinayg-cp opened this issue Sep 19, 2018 · 5 comments

Comments

@vinayg-cp
Copy link

I'm submitting a...


[x] Bug report  
[ ] Feature request
[ ] Documentation issue or request

In package


[ ] @ng-toolkit/init
[ ] @ng-toolkit/serverless
[x] @ng-toolkit/universal
[ ] @ng-toolkit/pwa
[ ] @ng-toolkit/firebug

Current behavior

When trying to install the ng-toolkit in a ngx-rocket generated project.
It returns the following error:

INFO: Project property is set to 'demo-pwa'.
ERROR: The file (./src/@app/app.module.ts) does not exist.
ERROR: If you think that this error shouldn't occur, please fill up bug report here: https://github.com/maciejtreder/ng-toolkit/issues/new
INFO: stacktrace has been sent to tracking system.

When I try to run the following command:

npm run build:prod

I get following error:

npm ERR! missing script: build:prod
npm ERR!
npm ERR! Did you mean this?
npm ERR!     build

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Dev-15\AppData\Roaming\npm-cache\_logs\2018-09-19T09_51_05_294Z-debug.log

PS: Works fine in a normal ng generated project

Expected behavior

The installation should not return error.
And we should be able to run

npm run build:prod
npm run server

Minimal reproduction of the problem with instructions

  1. Install ngx client by following steps here: https://github.com/ngx-rocket/generator-ngx-rocket/tree/master/cli
  2. Create a new project
  3. Within the new project try installing ng-toolkit
  4. It should return an error saying app.module.ts is not found, even though it is there.

Example repository

Demo PWA: https://github.com/vinayg-cp/demo-pwa.git

What is the motivation / use case for changing the behavior?

Need to make an ngx based project more SEO friendly.

Environment


Angular CLI: 6.1.5
Node: 8.11.4
OS: win32 x64
Angular: 6.1.7
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router, service-worker

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.7.5
@angular-devkit/build-angular     0.7.5
@angular-devkit/build-optimizer   0.7.5
@angular-devkit/build-webpack     0.7.5
@angular-devkit/core              0.7.5
@angular-devkit/schematics        0.7.5
@angular/cli                      6.1.5
@ngtools/webpack                  6.1.5
@schematics/angular               0.7.5
@schematics/update                0.7.5
rxjs                              6.3.2
typescript                        2.9.2
webpack                           4.9.2
Others:

@nitindig
Copy link

nitindig commented Feb 8, 2019

Facing this issue. Any solution in place?

@steebchen
Copy link

steebchen commented May 18, 2019

I have a similar problem, but in my case it says '/src/~/app.module.ts' could not be found.

@steebchen
Copy link

It seems that it probably can't read tsconfig custom paths. Howver, if I use a relative url in my main.ts (import { AppModule } from './app/app.module' instead of ~/app.module in my case) it results in another even less helpful error where it just doesn't log any message:

Installed packages for tooling via yarn.
ERROR: 
ERROR: If you think that this error shouldn't occur,

@steebchen
Copy link

@KingDarBoja Why did you close this issue?

@KingDarBoja
Copy link
Collaborator

@steebchen Closed as the original post was too old and also there is a new version available at npm. If you still have a issue, I would recommend opening a new issue with reproduction steps or a sample repo to look at.

I am working right now on the next release (#745) and I do wish to fix most common issues with these packages.

Cheers!

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

4 participants