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 alpha 6-3 - url_resolver.js:238Uncaught TypeError: uri.match is not a function, when using latest compiler-builds #963

Closed
qdouble opened this issue Aug 9, 2016 · 5 comments

Comments

@qdouble
Copy link

qdouble commented Aug 9, 2016

Building a project with alpha 6-3 and the latest compiler build using ngModules seems to crash when you use materials modules. This commit to the compiler broke it: angular/angular@83e2d3d

On line 238 of url_resolver.js, if you change

function _split(uri) {
    return uri.match(_splitRe);
}

to

function _split(uri) {
   if (typeof uri === 'string')
    return uri.match(_splitRe);
}

it will work, as it appears that the material modules are exporting numbers instead of strings. If I console.log uri, MdButtonModule will pass it the number 436 and also the string 'package:436' for example. The number is causing the crash.

I know it was mentioned that this is experimental release, but just making sure that this is a known issue and addressed before next release.

@jelbourn
Copy link
Member

jelbourn commented Aug 9, 2016

I don't think this is an issue with the released alpha.7. Feel free to re-file if you're still running into a problem.

@MatteoNY
Copy link

I updated to MD2 ^2.0.0-alpha.7-7 and I had the same problem. Thanks qdouble for your fix it resolved the issue. RC-5 CLI with webpack.2. :-)

@ggranum
Copy link

ggranum commented Aug 24, 2016

Same issue as @MatteoNY, but updating to 2.0.0-alpha.7-8. I reverted to known-good 2.0.0-alpha.7-2 and incremented the version upward until it started breaking again: 2.0.0-alpha.7-5 works, 2.0.0-alpha.7-6 throws the error, as does 2.0.0-alpha.7-8 ( I didn't actually test alpha.7-7)

Uncaught TypeError: uri.match is not a function:
_split  @   url_resolver.js:238
getUrlScheme    @   url_resolver.js:80
componentModuleUrl  @   metadata_resolver.js:750
CompileMetadataResolver.getDirectiveMetadata    @   metadata_resolver.js:155
(anonymous function)    @   metadata_resolver.js:267
CompileMetadataResolver.getNgModuleMetadata @   metadata_resolver.js:260
(anonymous function)    @   metadata_resolver.js:252
CompileMetadataResolver.getNgModuleMetadata @   metadata_resolver.js:239

@jelbourn
Copy link
Member

The @latest tag on npm still points to alpha.7-4. Releases above that are tagged as @experimental and are not meant for general consumption (they're typically us testing integrations with in-progress work on angular core or Google internal tooling).

@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

No branches or pull requests

4 participants