Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

1.5K
Visualizações
"Angular structure loaded both synchronously and asynchronously" while importing a lib into another

I have the following Angular 12 workspace:

projects/
  lib_a/
  lib_b/
  host/

Where basically:

  • lib_a contains some UI kit
  • lib_b handles authentication stuff and depends on lib_a to reuse the UI kit
  • host is an app that imports both libs

What I'm wondering is... is this possible? Can I import lib_a into its sibling lib_b?

Both libs can be built just fine but as soon as I try to import one into the other (say, lib_a into lib_b) I get the following error:

Building entry point 'lib_b'
------------------------------------------------------------------------------
✖ Compiling with Angular in legacy View Engine compilation mode.
ERROR: Angular structure loaded both synchronously and asynchronously

I googled the error and found this previous question: How to fix: Error: Angular structure loaded both synchronously and asynchronously, so I reviewed all imports and they seem to be OK, then disabled Ivy for both libs and checked that there aren't any missing dependencies. Still got nothing.

None of these libraries is published so a local solution would be preferred (i.e. I can't deploy the package to NPM/GitHub yet).

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I also failed setting up an angular workspace with a library that references another library (= monorepo). You should create an NX workspace instead.

  • Here are the commands I did
  • Here is a demo project with all instructions
  • nx.dev

This DOES in fact allow you to reference libraries from applications, and libraries from other libraries, all in the same workspace.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda