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

wdm: Failed to compile on new project #352

Closed
1 of 3 tasks
Viatorus opened this issue Aug 7, 2018 · 10 comments
Closed
1 of 3 tasks

wdm: Failed to compile on new project #352

Viatorus opened this issue Aug 7, 2018 · 10 comments
Labels

Comments

@Viatorus
Copy link

Viatorus commented Aug 7, 2018

I'm submitting a...

  • Bug report
  • Feature request
  • Documentation issue or request

Current behavior

npm start fails on new project

> npm run env -s && ng serve --aot --proxy-config proxy.conf.js

** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
 10% building modules 3/3 modules 0 active[HPM] Proxy created: /api  ->  https://api.chucknorris.io
[HPM] Proxy rewrite rule created: "^/api" ~> ""
                                                                                          
Date: 2018-08-07T18:42:52.387Z
Hash: a85ceaa0d288dcd9fcda
Time: 9825ms
chunk {main} main.js, main.js.map (main) 1.93 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 681 bytes [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 5.22 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 85.2 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 325 kB [initial] [rendered]

ERROR in node_modules/@angular/forms/src/form_providers.d.ts(22,9): error TS2315: Type 'ModuleWithProviders' is not generic.
node_modules/@angular/platform-browser/src/browser.d.ts(38,9): error TS2315: Type 'ModuleWithProviders' is not generic.
node_modules/@angular/router/src/router_module.d.ts(101,60): error TS2315: Type 'ModuleWithProviders' is not generic.
node_modules/@angular/router/src/router_module.d.ts(105,38): error TS2315: Type 'ModuleWithProviders' is not generic.

 「wdm」: Failed to compile.

Expected behavior

wdm does not fail

Minimal reproduction of the problem with instructions

Create a new generator-ngx-rocket project an run npm start or npm run build.

Environment

- generator version: 5.0.1
- node version: 8.11.3  <!-- run `node --version` -->
- npm version: 5.6.0  <!-- run `npm --version` -->
- OS:  Linux<!-- Mac, Linux, Windows -->

Config:
? What kind of app do you want to create? Web app
? Do you want a progressive web app? (with manifest and service worker) Yes
? Which UI framework do you want? Angular Material (more website-oriented)
? Which kind of layout do you want? Simple responsive header bar (more website-oriented)
? Do you want authentication? No
? Do you want lazy loading? Yes
? Do you want analytics support (with Angulartics2)? No
@sinedied
Copy link
Member

I cannot seem to reproduce the issue, from the logs it's possible that was an angular issues that may have been patched in the meanwhile.

Can you retry to see if you still have the issue, running this commands before to make sure tou have the latest versions?

npm rm -g @angular/cli generator-ngx-rocket
npm cache clean --force
npm i generator-ngx-rocket
ngx new

@elenat82
Copy link

Hi,
it's the first time I use your generator and I can't start a new project too, here is my configuration:

C:\Users\User>node --version
v8.11.3

C:\Users\User>npm --version
5.6.0

OS: Windows 10

what I did

npm rm -g @angular/cli generator-ngx-rocket
removed 660 packages in 72.048s

npm cache clean --force
npm WARN using --force I sure hope you know what you are doing.

npm i -g generator-ngx-rocket (I added -g)
C:\Users\User\AppData\Roaming\npm\ngx -> C:\Users\User\AppData\Roaming\npm\node_modules\generator-ngx-rocket\cli\bin\ngx

  • generator-ngx-rocket@5.0.1
    added 417 packages in 75.937s

mkdir angular6

cd angular6

ngx new
? What's the name of your app? angular6
? What kind of app do you want to create? Web app
? Do you want a progressive web app? (with manifest and service worker) Yes
? Which UI framework do you want? Bootstrap (more website-oriented)
? Do you want authentication? Yes
? Do you want lazy loading? Yes
? Do you want analytics support (with Angulartics2)? No

npm start

angular-6@1.0.0 start C:\Users\User\angular6
npm run env -s && ng serve --aot --proxy-config proxy.conf.js

** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
10% building modules 3/3 modules 0 active[HPM] Proxy created: /api -> https://api.chucknorris.io
[HPM] Proxy rewrite rule created: "^/api" ~> ""
Date: 2018-08-10T08:41:46.508Z
Hash: 79a403159f98bba4bc9d
Time: 26145ms
chunk {app-about-about-module-ngfactory} app-about-about-module-ngfactory.js, app-about-about-module-ngfactory.js.map (app-about-about-module-ngfactory) 15.1 kB [rendered]
chunk {main} main.js, main.js.map (main) 223 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 227 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 8.03 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 238 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 3.8 MB [initial] [rendered]
i 「wdm」: Compiled successfully.

Now the app has been created but I tried just changing a class in login.component.html and it failed to compile:

i 「wdm」: Compiling...

Date: 2018-08-10T08:45:30.774Z - Hash: 128e6d78f68c5fd8ee77 - Time: 7424ms
3 unchanged chunks
chunk {app-about-about-module-ngfactory} app-about-about-module-ngfactory.js, app-about-about-module-ngfactory.js.map (app-about-about-module-ngfactory) 17.5 kB [rendered]
chunk {main} main.js, main.js.map (main) 277 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 3.83 MB [initial] [rendered]

ERROR in ./src/app/app.module.ngfactory.js
Module not found: Error: Can't resolve '@angular/router.ngfactory' in 'C:\Users\User\angular6\src\app'
ERROR in ./src/app/about/about.module.ngfactory.js
Module not found: Error: Can't resolve '@angular/router.ngfactory' in 'C:\Users\User\angular6\src\app\about'
i 「wdm」: Failed to compile.

@sinedied
Copy link
Member

@elenat82 Unfortunately, the latest Angular CLI released is buggy, see angular/angular-cli#11835

Try npm i @angular/cli@6.1.1 until the bug is fixed on their side.

I'm really considering to fix the angular/cli version in generated projects, as issues like this pops up quite often (but should'nt...) 😞

@elenat82
Copy link

Thanks sinedied,
but unfortunately nothing changed.....

I did:

npm i -g @angular/cli@6.1.1
C:\Users\User\AppData\Roaming\npm\ng -> C:\Users\User\AppData\Roaming\npm\node_modules@angular\cli\bin\ng
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules@angular\cli\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

  • @angular/cli@6.1.1
    added 248 packages in 44.346s

Then cd into my folder, npm start, save a file (without changing a line) and same error as before

@sinedied
Copy link
Member

Whoops sorry I was too quick to type, it's the @angular/compiler-cli to downgrade, as pointer in the issue I linked, you can try:

npm i @angular/compiler-cli@6.1.1

In the linked issue, I worked for some but I tried it and also tried to downgrade @angular-devkit/build-angular with no luck. 😢

The only solution that worked for me was to remove the --aot flag in the package.json, meanwhile they fix it.

@elenat82
Copy link

So I tried this:

removed --aot flag from package.json line 8

hardcoded version of @angular/compiler-cli to "6.1.1" in package.json line 42

npm install
npm WARN @angular/compiler-cli@6.1.1 requires a peer of @angular/compiler@6.1.1 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap@4.1.3 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap@4.1.3 requires a peer of popper.js@^1.14.3 but none is installed. You must install peer dependencies yourself.
npm WARN postcss-html@0.23.7 requires a peer of postcss-syntax@^0.10.0 but none is installed. You must install peer dependencies yourself.
npm WARN postcss-markdown@0.23.7 requires a peer of postcss-syntax@^0.10.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

updated 1 package in 30.045s

npm start

Now it seems to work, thank you!

@sinedied
Copy link
Member

Closing as the bug in @angular/compiler-cli has been fixed, see angular/angular-cli#11835

@ghost
Copy link

ghost commented Apr 4, 2019

× 「wdm」: Built at: 04/04/2019 10:44:55 AM

ERROR in 1
i 「wdm」: Failed to compile.

@sinedied
Copy link
Member

sinedied commented Apr 5, 2019

@mcbrideut Have you tried the solution of the 2nd post?

npm rm -g @angular/cli generator-ngx-rocket
npm cache clean --force
npm i generator-ngx-rocket
ngx new

@ghost
Copy link

ghost commented Apr 5, 2019

I saw that after I posted. It did work, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants