Skip to content

bug(rc5 and alpha7)url_resolver.js:238Uncaught TypeError: uri.match is not a function #974

Closed

Description

@qdouble

I'm refiling for this issue: #963 as it was not resolved in alpha 7. I've tested it on two fresh seed projects and the error still occurs, so it should be a common problem with Webpack at least, not sure if this shows up in a SystemJS build or not.

Activity

  1. FoodBuster commented on Aug 9, 2016

    @FoodBuster

    I second this. Having the same problem, using the new angular-cli webpack release.

  2. qdouble commented on Aug 10, 2016

    @qdouble
    Author

    This seems to be related to how it's dealing with the moduleId, if you comment out the moduleId of the components, they compile without error.

  3. qdouble commented on Aug 10, 2016

    @qdouble
    Author

    It appears this pull request will fix this issue angular/angular@f54f9ef. You guys can close this if you want to as it appears to be an angular compiler issue and not specific to material

  4. FoodBuster commented on Aug 10, 2016

    @FoodBuster

    qdouble, that pull request does fix the "TypeError: uri.match is not a function" problem, but results in another error (BaseException) for me with the following message:

    Template parse errors:↵Can't bind to 'md-ripple-trigger' since it isn't a known property of 'div'. ("*ngIf="isRippleEnabled()" class="md-button-ripple" [class.md-button-ripple-round]="isRoundButton()" [ERROR ->][md-ripple-trigger]="getHostElement()" [md-ripple-color]="isRoundButton() ? 'rgba(255, 255, 255, 0.2)"): MdButton@0:180↵Can't bind to 'md-ripple-color' since it isn't a known property of 'div'. ("ton-ripple" [class.md-button-ripple-round]="isRoundButton()" [md-ripple-trigger]="getHostElement()" [ERROR ->][md-ripple-color]="isRoundButton() ? 'rgba(255, 255, 255, 0.2)' : ''" md-ripple-background-color="rgb"): MdButton@0:219

    Not sure if it's related, and if it's not, happy to open a new issue.

  5. qdouble commented on Aug 10, 2016

    @qdouble
    Author

    @FoodBuster that's an unrelated error, it saying 'md-ripple-trigger' isn't defined on the MdButton directive/component.

  6. FoodBuster commented on Aug 10, 2016

    @FoodBuster

    @qdouble Thanks, got it working.

  7. jelbourn commented on Aug 10, 2016

    @jelbourn
    Contributor

    I have released an alpha.7-2 that should fix this.

  8. aminebizid commented on Aug 11, 2016

    @aminebizid

    Thanks

  9. neclepsio commented on Aug 11, 2016

    @neclepsio

    Maybe I'm doing something wrong, but simply upgrading to alpha.7-2 doesn't fix for me.

  10. qdouble commented on Aug 11, 2016

    @qdouble
    Author

    @neclepsio it's possible another component or 3rd party plugin in your application has a moduleId.

  11. neclepsio commented on Aug 11, 2016

    @neclepsio

    @qdouble I don't think so. I'm just using BrowserModule, FormsModule and several Ms...Module. How can I check? Thank you.

  12. neclepsio commented on Aug 11, 2016

    @neclepsio

    @qdouble You were right! My own app.component had a moduleId!

  13. some1awesome commented on Aug 26, 2016

    @some1awesome

    @jelbourn Your fix in alpha.7-2 works for me, but it appears the problem was reintroduced somewhere before alpha.7-9. Can you try to fix it in again?

  14. qdouble commented on Aug 27, 2016

    @qdouble
    Author

    @zackporter92 this caused it to pop back up: #1101

  15. some1awesome commented on Aug 27, 2016

    @some1awesome

    @qdouble interesting. So we should just stick to 7-2 if we have that problem?

  16. qdouble commented on Aug 27, 2016

    @qdouble
    Author

    For temporary workaround, you can put this as a preloader in your webpack config, just npm install string-replace-loader

    preLoaders: [
          {
            test: /.js$/,
            loader: 'string-replace-loader',
            query: {
              search: 'moduleId: module.id,',
              replace: '',
              flags: 'g'
            }
          },
    

    or on @angular/compiler/src/url_resolver.js line 238, you can change
    return uri.match(_splitRe); to return uri.toString().match(_splitRe);

  17. DerejeKitaw commented on Sep 25, 2016

    @DerejeKitaw

    I get same error. I am using final release Angular2.
    "Uncaught TypeError: uri.match is not a function"

    It work when I remove "moduleId: module.id" from contact component.

  18. angular-automatic-lock-bot commented on Sep 5, 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.

  19. locked and limited conversation to collaborators on Sep 5, 2019
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions