Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

app-cabecalho não é um elemento conhecido

3 unchanged chunks

Build at: 2024-04-27T19:46:14.034Z - Hash: 0b46db4452166466 - Time: 396ms

./src/app/app.module.ts:8:0-104 - Error: Module not found: Error: Can't resolve './pensamentos/criar-pensamentos/criar-pensamentos.component' in 'C:\Users\Luara\Documents\Luara\Alura\Framework Angular\memoteca\src\app'

Error: src/app/app.component.html:1:1 - error NG8001: 'app-cabecalho' is not a known element:

  1. If 'app-cabecalho' is an Angular component, then verify that it is part of this module.
  2. If 'app-cabecalho' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

1


  src/app/app.component.ts:5:16
    5   templateUrl: './app.component.html',
                     ~~~~~~~~~~~~~~~~~~~~~~
    Error occurs in the template of component AppComponent.


Error: src/app/app.component.html:3:5 - error NG8001: 'app-criar-pensamentos' is not a known element:
1. If 'app-criar-pensamentos' is an Angular component, then verify that it is part of this module.
2. If 'app-criar-pensamentos' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

3     <app-criar-pensamentos></app-criar-pensamentos>
      ~~~~~~~~~~~~~~~~~~~~~~~

  src/app/app.component.ts:5:16
    5   templateUrl: './app.component.html',
                     ~~~~~~~~~~~~~~~~~~~~~~
    Error occurs in the template of component AppComponent.


Error: src/app/app.component.html:5:1 - error NG8001: 'app-rodape' is not a known element:
1. If 'app-rodape' is an Angular component, then verify that it is part of this module.
2. If 'app-rodape' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

5 <app-rodape></app-rodape>
  ~~~~~~~~~~~~

  src/app/app.component.ts:5:16
    5   templateUrl: './app.component.html',
                     ~~~~~~~~~~~~~~~~~~~~~~
    Error occurs in the template of component AppComponent.


Error: src/app/app.module.ts:8:43 - error TS2307: Cannot find module './pensamentos/criar-pensamentos/criar-pensamentos.component' or its corresponding type declarations.

8 import { CriarPensamentosComponent } from './pensamentos/criar-pensamentos/criar-pensamentos.component';
                                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Error: src/app/app.module.ts:11:17 - error NG1010: Value at position 3 in the NgModule.declarations of AppModule is not a reference
  Value could not be determined statically.

 11   declarations: [
                    ~
 12     AppComponent,
    ~~~~~~~~~~~~~~~~~
...
 15     CriarPensamentosComponent
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 16   ],
    ~~~

  src/app/app.module.ts:15:5
    15     CriarPensamentosComponent
           ~~~~~~~~~~~~~~~~~~~~~~~~~
    Unknown reference.
2 respostas
solução!

Olá, Luara, tudo bem?

O erro 'app-cabecalho' is not a known element sugere que o Angular não está reconhecendo app-cabecalho como um componente. Isso geralmente acontece quando o componente não foi declarado corretamente no módulo correspondente. Portanto, verifique se você criou um componente cabecalho e se ele foi importado e declarado corretamente no array declarations de AppModule.

Exemplo:

import { CabecalhoComponent } from './caminho/para/cabecalho.component';

@NgModule({
  declarations: [
    CabecalhoComponent,
    // outros componentes
  ],
  // imports, providers, etc.
})
export class AppModule { }

O mesmo serve para os componentes app-criar-pensamentos e app-rodape.

Há também o erro Cannot find module './pensamentos/criar-pensamentos/criar-pensamentos.component' que indica um problema no caminho especificado no import. Verifique se o caminho está correto e que o arquivo existe nesse diretório.

Verifique esses pontos e ajuste conforme necessário.

Espero ter ajudado.

Abraços e bons estudos!

Caso este post tenha lhe ajudado, por favor, marcar como solucionado ✓. Bons Estudos!

Muito obrigada, pela ajudar

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software