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

Fix 2.1.1 _private_ import issues #606

Closed

Description

@MarkPieszak
  • I'm submitting a ...
  • bug report
  • What modules are related to this Issue?
  • platform-node

In the latest Core/Compiler upgrades to 2.1.1, compiler-private & core-private have changed a few things Universal uses.

__compiler_private__ looks to of been removed from @angular/compiler.

SelectorMatcher & CssSelector (needed for Universal), seem to be public now.

Also _ViewUtils seems to be missing / removed from __core_private__
It looks like it was renamed to view_utils ?

Seems to fix it:

import {
  SelectorMatcher as SelectorMatcher211, 
  CssSelector as CssSelector211 } from '@angular/compiler';

let SelectorMatcher;
let CssSelector;

if (SelectorMatcher211 && CssSelector211) {
  SelectorMatcher = SelectorMatcher211;
  CssSelector = CssSelector211;
} else {
  const _compiler_private_  = require('@angular/compiler').__compiler_private__;
  SelectorMatcher = _compiler_private_.SelectorMatcher;
  CssSelector = _compiler_private_.CssSelector;
}

ViewUtils -> view_utils can be handled in a similar way.

Activity

  1. obenjiro commented on Nov 20, 2016

    @obenjiro

    Can we merge this? Or is there any issues with this PR?

  2. stanbe commented on Nov 28, 2016

    @stanbe

    Any news on this issue?

  3. MarkPieszak commented on Nov 28, 2016

    @MarkPieszak
    ContributorAuthor

    I'll talk to Pat about it today and let you guys know @stanbe @AiBoy.
    We have a nice workaround file for now you can use (and import at the top of your browser/node modules) for the time being as well. (https://github.com/angular/universal-starter/tree/master/src - you can see the workaround files in here)

  4. 0radek commented on Dec 13, 2016

    @0radek

    Hi. Is this issue fixed? I am still getting this error, using angular2-universal version ~2.1.0-rc.1

  5. 0radek commented on Dec 13, 2016

    @0radek

    @MarkPieszak I followed the link you posted and added those files to my project, and then imported the appropriate ones into my client.ts and server.ts

    Unfortunately I'm still getting the same error. Here are my versions, if that is any help too:

        "@angular/common": "~2.1.2",
        "@angular/compiler": "~2.1.2",
        "@angular/core": "~2.1.2",
        "@angular/forms": "~2.1.2",
        "@angular/http": "~2.1.2",
        "@angular/platform-browser": "~2.1.2",
        "@angular/platform-browser-dynamic": "~2.1.2",
        "@angular/platform-server": "~2.1.2",
        "angular2-express-engine": "~2.1.0-rc.1",
        "angular2-platform-node": "~2.1.0-rc.1",
        "angular2-universal": "~2.1.0-rc.1",
        "angular2-universal-polyfills": "~2.1.0-rc.1",
    
  6. MarkPieszak commented on Dec 13, 2016

    @MarkPieszak
    ContributorAuthor

    You have it setup similar to how the starters have it? Included at the top of each of those files? @ScaryWolfMan

  7. 0radek commented on Dec 14, 2016

    @0radek

    @MarkPieszak Yep! :(

  8. colltoaction commented on Dec 14, 2016

    @colltoaction
  9. 0radek commented on Dec 14, 2016

    @0radek

    I'm a newibe to universal but it seems like a pretty daunting task trying to manage all the various angular projects and making sure everything works. :o

  10. stanbe commented on Dec 14, 2016

    @stanbe

    This error is rather annoying and the workaround is by definition just a workaround, not really satisfying. Is there still an issue with the pull request? @MarkPieszak @AiBoy

  11. obenjiro commented on Dec 14, 2016

    @obenjiro

    @stanbe I'm not a maintainer :/ so I can't do anything about it.

    And yes, we have Angular 2.3 already, but I still can't update Angular-Universal. This is sad.

  12. MarkPieszak commented on Dec 14, 2016

    @MarkPieszak
    ContributorAuthor

    Let me make sure the workaround still works for the latest Angular release and I'll talk to @gdi2290 about it, see if it's possible to squeeze this in there!
    Apologies guys!

  13. 0radek commented on Dec 15, 2016

    @0radek

    @MarkPieszak I've reverted to 2.10 and I'm able to run my project without any issues at the moment.

  14. fdambrosio commented on Dec 18, 2016

    @fdambrosio

    how can we build with universal? We're started using angular2-webpack-starter

  15. MarkPieszak commented on Dec 18, 2016

    @MarkPieszak
    ContributorAuthor

    Check out the universal node starter to see what you need to add to the webpack-starter, check out the documentation.md file here as well that talks about the necessary files. @fdambrosio

  16. fdambrosio commented on Dec 19, 2016

    @fdambrosio

    thanks @MarkPieszak we have "Call to Node module failed with error: TypeError: Cannot read property 'SelectorMatcher' of undefined" message error

  17. MarkPieszak commented on Dec 19, 2016

    @MarkPieszak
    ContributorAuthor

    If you're using the workaround I think you can't use Angular 2.3 as some other things changed. Can you take it down to 2.2 and see if it works?
    As we move some Core things from Universal into AngularCore itself, it'll help alleviate problems like this from happening!

  18. 0radek commented on Dec 19, 2016

    @0radek

    @MarkPieszak I was having the same issue, but I'm now using angular 2.1.0 and angular-universal 2.0.11. no longer getting any issues :(

  19. dimonzav commented on Dec 27, 2016

    @dimonzav

    Workarounds from universal-starter repository is working well with Angular 2.4.1!

  20. MarkPieszak commented on Dec 27, 2016

    @MarkPieszak
    ContributorAuthor

    Oh that's great news 👍 haven't been able to check on holiday this week. @dimonzav

  21. szykov commented on Jan 1, 2017

    @szykov

    @dimonzav I just tried update to 2.4.1 version and adding files: __workaround.browser, __workaround.node.
    Then adding appropriate import statements to server.ts and client.ts files and it didn't work. What did you do or what I did wrong?

  22. PatrickJS commented on Jan 8, 2017

    @PatrickJS
    Contributor

    will be fixed in ng4
    angular/angular#13822

  23. ParkourKarthik commented on Feb 17, 2017

    @ParkourKarthik

    I tried the workaround. But still facing the problem in angular@2.4.7; currently using the latest 2.1.0-rc.1 version of Universal. Anything more to do?

  24. MarkPieszak commented on Feb 17, 2017

    @MarkPieszak
    ContributorAuthor

    Do you have it setup just like in the universal starter? @ParkourKarthik

  25. ParkourKarthik commented on Feb 21, 2017

    @ParkourKarthik

    I'm a noob and I'm using the Asp.net Core with Angular template. I faced this when I upgraded all my packages to the latest version. But now I downgraded all packages to the same in the template (2.0.10); so working for now.
    I'm scared of upgrading the packages again. It seems there are multiple dependencies of packages which raise these errors; any guidelines would be helpful.

  26. MarkPieszak commented on Feb 21, 2017

    @MarkPieszak
    ContributorAuthor

    This template here has everything a little more up to date and is .net, take a look at the dependencies. https://github.com/MarkPieszak/aspnetcore-angular2-universal

    Don't worry about warnings during install for now. @ParkourKarthik

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

  28. locked and limited conversation to collaborators on Sep 4, 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