Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Broken building with material-tools #11751

Closed

Description

@norkunas

Bug, enhancement request, or proposal:

Bug

CodePen and steps to reproduce the issue:

CodePen Demo which demonstrates the issue:

None

Detailed Reproduction Steps:

  1. Use https://github.com/angular/material-tools

What is the expected behavior?

Should build properly.

What is the current behavior?

When building distribution files with material-tools builder it throws ReferenceError: navigator is not defined.

What is the use-case or motivation for changing an existing behavior?

Which versions of AngularJS, Material, OS, and browsers are affected?

  • AngularJS: 1.7.8
  • AngularJS Material: 1.1.19.
  • OS: Any
  • Browsers: -

Is there anything else we should know? Stack Traces, Screenshots, etc.

Navigator check was updated in 244619a

Activity

  1. self-assigned this
    on Jun 25, 2019
  2. added
    P2: required
    severity: regression
    on Jun 25, 2019
  3. added this to the 1.1.20 milestone on Jun 25, 2019
  4. Splaktar commented on Jun 25, 2019

    @Splaktar
    Contributor

    Thank you for the report.

    Does something like the following fix it for you locally?

    if (navigator) {
      var userAgent = navigator.userAgent || navigator.vendor || window.opera;
      var isIos = userAgent.match(/ipad|iphone|ipod/i);
      var isAndroid = userAgent.match(/android/i);
    }
  5. added a commit that references this issue on Jun 25, 2019
    5a65515
  6. added
    needs: feedback
    on Jun 25, 2019
  7. norkunas commented on Jun 26, 2019

    @norkunas
    ContributorAuthor

    With your sample it still throws, but this works:

    if (window.navigator) {
      var userAgent = window.navigator.userAgent || window.navigator.vendor || window.opera;
      var isIos = userAgent.match(/ipad|iphone|ipod/i);
      var isAndroid = userAgent.match(/android/i);
    }
  8. added a commit that references this issue on Jun 26, 2019
    5e82880
  9. added
    has: Pull Request
    and removed
    needs: feedback
    on Jun 26, 2019
  10. added a commit that references this issue on Jul 10, 2019
    0077d3e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2: requiredhas: Pull Requestresolution: fixedseverity: regressiontype: bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions