Angular : unable to load component from library : Cannot read properties of null (reading '11') - TagMerge
3Angular : unable to load component from library : Cannot read properties of null (reading '11')Angular : unable to load component from library : Cannot read properties of null (reading '11')

Angular : unable to load component from library : Cannot read properties of null (reading '11')

Asked 1 years ago
0
3 answers

the solution was to adding the option "preserveSymlinks":true to angular.json

"projects": {
    "myapp": {
      "root": "",
      "sourceRoot": "src",
      "projectType": "application",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "preserveSymlinks": true,
       ...
  
        

Source: link

0

ERROR: The request could not be satisfied
Generated by cloudfront (CloudFront)
Request ID: xCn3kpGiRfp9pwkGpAaBSyb4pvIEKr2H4kH-keUdo-BEt8u1eU8jZQ==

Source: link

0

All this means is that you are trying to access a property of an object that is undefined. These usually happens when we don't test an object before using it. Here is a common scenario.
// We want to get the value of an input. 
var inputVal = document.getElementById("input").value;
This will result in Uncaught TypeError: Cannot read property 'value' of null. The reason will be that the element with id input does not exist. Let me break it down in simpler steps;
var input = document.getElementById("input"); 
input // when this fails, it returns null. input = null
var inputVal = input.value;
// this is the same as the following. 
var inputVal = null.value;
// null does not have the property 'value'
When you break it down, the error actually makes sense. To make sure that you don't get this error, you have to make sure that btn, or any object you use, is not null before you use it. For our example:
var input = document.getElementById("btn");
var inputVal = "";
if (input) {
    inputVal = input.value;
}
Please, tell me where are de error.
<!DOCTYPE html>
<html lang="pt-br>
    <head>
        <meta charset= "utf-8">
    <title>Detran</title>
        <style>

        </style>
    </head>
    <body>
    <h1>Sistema de multa</h1>
    Velocidade do carro<input type="Number" name="txtvel" id="txtvel"> km por hora
        <input type="button" value="Verificar" onclick = "calcular()">
             <div id="res"> 
            </div>
    <script>
        function calcular() {
            var txtv = window.document.getElementById("txt#vel")
            var resp = window.document.querySelector("div#res")
            var vel = Number(txtv.value)
            resp.InnerText = `Sua velocidade atual é de ${vel}`
        }
    </script>
    </body>
</html>
You have an error in this line:
var txtv = window.document.getElementById("txt#vel")

Source: link

Recent Questions on angular

    Programming Languages