Skip to content

serviceWorker = true fails to find @angular/service-worker with yarn workspaces #8300

Closed

Description

@spiffyjr

Bug Report or Feature Request (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request

Versions.

Angular CLI 1.5.0
Node: 6.10.3

Repro steps.

Use yarn workspaces, set serviceWorker = true in angular-cli.json.

The log given by the failure.

Your project is configured with serviceWorker = true, but @angular/service-worker
is not installed. Run npm install --save-dev @angular/service-worker
and try again, or run ng set apps.0.serviceWorker=false in your .angular-cli.json.

Desired functionality.

The error shouldn't be fatal for an undetected service worker module. It should probably be a warning and able to be disabled similar to the TypeScript warnings for incorrect versions.

Mention any other details that might be useful.

Activity

  1. self-assigned this
    on Nov 3, 2017
  2. added
    P5
    on Nov 3, 2017
  3. metasong commented on Dec 7, 2017

    @metasong

    yes, meet this problem too.

    this is because these 2 lines:
    const nodeModules = path.resolve(projectRoot, 'node_modules');
    const swModule = path.resolve(nodeModules, '@angular/service-worker');

    currently i'm using yarn workspace and my @angular/service-worker is in a parrent folder's nodeModules.

    should change the logic to find node_modules in parents folders

  4. added 3 commits that reference this issue on Jan 25, 2018
    4a8f5bd
    bd4cdb0
    555424e
  5. added a commit that references this issue on Apr 23, 2018
    700a94b
  6. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  7. locked and limited conversation to collaborators on Sep 7, 2019
  8. added a commit that references this issue on May 29, 2026
    fc0d6c4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P5severity2: inconvenient

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions