Skip to content

bug alpha 6-3 - url_resolver.js:238Uncaught TypeError: uri.match is not a function, when using latest compiler-builds #963

Closed

Description

@qdouble

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.

Activity

  1. jelbourn commented on Aug 9, 2016

    @jelbourn
    Contributor

    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.

  2. MatteoNY commented on Aug 24, 2016

    @MatteoNY

    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. :-)

  3. ggranum commented on Aug 24, 2016

    @ggranum

    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
    
  4. jelbourn commented on Aug 24, 2016

    @jelbourn
    Contributor

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

  5. 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.

  6. 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