Giter VIP home page Giter VIP logo

Comments (20)

itsnotviktoriaaa avatar itsnotviktoriaaa commented on July 22, 2024 1

Oh, Jesus Christ😧 Thank you for your answer, it’s really interesting decision. I will have checked this as well, if it will be not a decision, just to do the same thing, I mean, to clear all and to start add parts of my code again. And yes, I have some directives, maybe two for forms, but, they are used on Login page and Sign up page, and this pages work well. But, I have noticed on your example, that your directive has @HostListener, I have the same on Header Component (and it’s one of components, which exist in my layout, when I get this error). Somehow, I have to check in my code. Of course, I will have commented after my checking in here:) Thank again for your decision

from angular.

itsnotviktoriaaa avatar itsnotviktoriaaa commented on July 22, 2024 1

Oh my goodness, check, I have found my problem!!!

It was my layout
image

And I have just change ./ on ./bar/bar.component and the same for header minute ago, i.e. right now I dont use index.ts for layout component and it's really weird for me, ambigious why it happends.

this work well
image

I have just provided you screen file "index.ts" when i was ./ and it didnt work when I linked on index.ts in layout.component
image

Thanks a lot, I have found with help of you my problem, but it's really strange, because I can link in other components with help of index.ts in another places:)

P.S WebStorm say to me that i can simplify my import like that (screen below), but when I had done that, I catched a problem as well
image

so I have decided to stay ./bar/bar.component and the same for header, because only this works well

from angular.

kolkov avatar kolkov commented on July 22, 2024 1

@itsnotviktoriaaa I'm very glad that this helped you quickly solve the problem)

from angular.

JeanMeche avatar JeanMeche commented on July 22, 2024

Hello, we reviewed this issue and determined that it doesn't fall into the bug report or feature request category. This issue tracker is not suitable for support requests, please repost your issue on StackOverflow using tag angular.

If you are wondering why we don't resolve support issues via the issue tracker, please check out this explanation.

from angular.

alan-agius4 avatar alan-agius4 commented on July 22, 2024

It's likely that there's an import cycle causing this issue.

from angular.

itsnotviktoriaaa avatar itsnotviktoriaaa commented on July 22, 2024

It's likely that there's an import cycle causing this issue.

No circular dependency found!

from angular.

JeanMeche avatar JeanMeche commented on July 22, 2024

Did you check that with tools like madge ?

from angular.

alan-agius4 avatar alan-agius4 commented on July 22, 2024

@itsnotviktoriaaa, in the case you do not have a circular reference. Kindly provide a minimal reproduction that we can take a look at.

from angular.

itsnotviktoriaaa avatar itsnotviktoriaaa commented on July 22, 2024

Did you check that with tools like madge ?

Yes)

from angular.

itsnotviktoriaaa avatar itsnotviktoriaaa commented on July 22, 2024

@itsnotviktoriaaa, in the case you do not have a circular reference. Kindly provide a minimal reproduction that we can take a look at.

I can provide you all my project, because it is test project. It's link on archive and on that archive I provide you my branches (alias branch), where I am trying to use alias. Login and signIn works fine (I can see and dont have error in console), but when I sign in with help of google (it's important, go to with help of that to route home), i see only white screen without elements or smth like that and in console i see error. Problem not in google auth, i just said about to order to be on home page you should use button sign in with google. In that link i provide you my app and credentials (problem iwas solved so i deleted this link). Problem is if my component load with help of lazy loading I get error below
also i provide develop branch where i dont use alias and all works well. Of course on develop branch more logic in comparison with alias branch, but, again, problem only start when i am trying to switch my project for using alias. Thank you for help!

app.routes.ts:22 ERROR TypeError: Cannot read properties of undefined (reading 'ɵcmp')
at getComponentDef (core.mjs:2529:12)
at extractDirectiveDef (core.mjs:2418:12)
at core.mjs:2592:21
at Array.map ()
at core.mjs:2592:10
at createTView (core.mjs:11394:63)
at getOrCreateComponentTView (core.mjs:11343:28)
at createRootComponentView (core.mjs:15966:49)
at ComponentFactory.create (core.mjs:15845:39)
at ViewContainerRef2.createComponent (core.mjs:16265:47)

from angular.

jprincon avatar jprincon commented on July 22, 2024

Yo tenia el mismo error y tenia un problema de referencia circular.

from angular.

itsnotviktoriaaa avatar itsnotviktoriaaa commented on July 22, 2024

No circular dependency found with help of madge(((

from angular.

kolkov avatar kolkov commented on July 22, 2024

In my case this error appears whea i add some directives into standalone component.
image
like this:
image
image
image

I had already broken all my eyes before I could find in the my app. 2 days of searching, in the end I turned off all modules, stay only the central layout component and got to the bottom of the directives.
17.3, NX, exbuild.

from angular.

kolkov avatar kolkov commented on July 22, 2024

@itsnotviktoriaaa Do you have any directives in the project?

from angular.

kolkov avatar kolkov commented on July 22, 2024

Thank again for your decision.

Well, this is not a solution yet, but it is a way to find a problem in a large project that has helped out many times...

from angular.

kolkov avatar kolkov commented on July 22, 2024

@itsnotviktoriaaa I think that in my case this happens because inside the library the IDE substitutes imports as from an external library (shortned link), perhaps it’s the same for you. Chech your index.tx file if exist.
image
and now:
image

from angular.

itsnotviktoriaaa avatar itsnotviktoriaaa commented on July 22, 2024

Right now, I have decided to comment my bar and header comp

image

and I haven't already catch this error, you can see below screen. Thefore, smth happend with Bar or Header Component, I'm going to investigate further

image

from angular.

itsnotviktoriaaa avatar itsnotviktoriaaa commented on July 22, 2024

Maybe someone can explain whi it happens? I want to close this issue

from angular.

JeanMeche avatar JeanMeche commented on July 22, 2024

This is the same issue as with circular deps. Circular imports can break class definitions at run time.

from angular.

itsnotviktoriaaa avatar itsnotviktoriaaa commented on July 22, 2024

But why medge didn't show me that if it's like a circular imports? Or it's not the same?

from angular.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.