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

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

Closed
qdouble opened this issue Aug 9, 2016 · 18 comments · Fixed by #984
Closed

Comments

@qdouble
Copy link

qdouble commented Aug 9, 2016

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.

@FoodBuster
Copy link

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

@qdouble
Copy link
Author

qdouble commented Aug 10, 2016

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.

@qdouble
Copy link
Author

qdouble commented Aug 10, 2016

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

@FoodBuster
Copy link

FoodBuster commented Aug 10, 2016

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.

@qdouble
Copy link
Author

qdouble commented Aug 10, 2016

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

@FoodBuster
Copy link

@qdouble Thanks, got it working.

devversion added a commit to devversion/material2 that referenced this issue Aug 10, 2016
> Removes the module ids of the component metadata.
> Since the templates and styles are now inlined, the module id has become unnecessary and
> can cause unexpected issues

This also fixes angular#974 in meanwhile.
jelbourn pushed a commit that referenced this issue Aug 10, 2016
> Removes the module ids of the component metadata.
> Since the templates and styles are now inlined, the module id has become unnecessary and
> can cause unexpected issues

This also fixes #974 in meanwhile.
@jelbourn
Copy link
Member

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

@aminebizid
Copy link

Thanks

@neclepsio
Copy link

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

@qdouble
Copy link
Author

qdouble commented Aug 11, 2016

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

@neclepsio
Copy link

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

@neclepsio
Copy link

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

@some1awesome
Copy link

@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?

@qdouble
Copy link
Author

qdouble commented Aug 27, 2016

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

@some1awesome
Copy link

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

@qdouble
Copy link
Author

qdouble commented Aug 27, 2016

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);

@DerejeKitaw
Copy link

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.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants