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.

Error on ng add @angular/pwa

See original GitHub issue

Versions

Angular CLI: 6.0.0-rc.6
Node: 9.2.0
OS: linux x64
Angular: 6.0.0-rc.5
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.5.6
@angular-devkit/build-angular     0.5.6
@angular-devkit/build-optimizer   0.5.6
@angular-devkit/core              0.5.6
@angular-devkit/schematics        0.5.8
@angular/cli                      6.0.0-rc.6
@angular/pwa                      0.5.8
@ngtools/json-schema              1.1.0
@ngtools/webpack                  6.0.0-rc.4
@schematics/angular               0.5.8
@schematics/update                0.5.8
rxjs                              6.0.0
typescript                        2.7.2
webpack                           4.5.0

Repro steps

ng new my-app cd my-app ng add @angular/pwa

Observed behavior

$ ng add @angular/pwa
Installing packages for tooling via npm.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ @angular/pwa@0.5.8
added 70 packages and removed 4 packages in 6.842s
Installed packages for tooling via npm.
Schematic input does not validate against the Schema: {"help":false,"h":false,"target":"build","configuration":"production"}
Errors:

  Data path "" should have required property 'project'.

Desired behavior

Add PWA super powers to my app

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

10reactions
rfk91commented, Apr 27, 2018

The following worked for me ng add @angular/pwa --project myprojectname

8reactions
collinduttercommented, Jun 22, 2018

@maeri yes, actually! In this file on line 137, it iterates over a list of strings, and does some work on them.

['build', 'test'].forEach((target) => {

  const applyTo = architect[target].options;

  if (!applyTo.assets) {
    applyTo.assets = [assetEntry];
  } else {
    applyTo.assets.push(assetEntry);
  }

});

In my angular.json, I had a ‘build’ section, but I had removed the ‘test’ section because I didn’t need it for my current project. So when it evaluated architect['test'].options it threw the error you’re seeing.

Not sure if this is the case for everyone, but it directly fixed it for me. Hope this helps!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Adding @angular/pwa not working on angular CLI
I'm trying to run the command ng add @angular/pwa --my project name so that I can implement service workers in my angular project...
Read more >
ng add @angular/pwa issues : r/Angular2 - Reddit
Attempting to deploy an Angular/Ionic PWA project via a CI/CD pipeline, which passes fine but visiting the site reveals following error: Failed ......
Read more >
Build failed after ng add @angular/pwa - Netlify Support Forums
Hello,. Can someone please help me as my build kept failing. The below error occurred after I run ng add @angular/pwa , did...
Read more >
@angular/pwa - npm
@angular/pwa. This is a schematic for adding Progress Web App support to an Angular app. Run the schematic with the Angular CLI: ng...
Read more >
Angular workspace configuration
Configures defaults for creating an application shell for a progressive web application (PWA), using the ng run <project>:app-shell command. In general, the ...
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