Pivot table not working when migrating to manifest Version: 5

Hello! The title itself says my problem. :smiling_face_with_tear:
Capturar2
html

	<table id="tabela">
		<thead>
			<tr>
				<th>Nome</th>
				<th>Idade</th>
				<th>Profiss√£o</th>
			</tr>
		</thead>
		<tbody>
		</tbody>
	</table>

js

    const pessoas = [
        { nome: 'Jo√£o', idade: 25, profissao: 'Engenheiro' },
        { nome: 'Maria', idade: 30, profissao: 'Médica' },
        { nome: 'Pedro', idade: 35, profissao: 'Professor' },
        { nome: 'Mauricio', idade: 45, profissao: 'Laboratorista' },
        { nome: 'Mauro', idade: 46, profissao: 'Vendedor' },
        { nome: 'Miguelzim', idade: 43, profissao: 'Vigilante' },
        { nome: 'Shulipa', idade: 16, profissao: 'Estudante' },
        { nome: 'Deusa', idade: 68, profissao: 'Aposentada' },
    ];
  function preencherTabela() {
          try {
            const tabela = document.querySelector('#tabela tbody');
  
            pessoas.forEach(pessoa => {
                const linha = document.createElement('tr');
                const colunaNome = document.createElement('td');
                const colunaIdade = document.createElement('td');
                const colunaProfissao = document.createElement('td');
  
                colunaNome.textContent = pessoa.nome;
                colunaIdade.textContent = pessoa.idade;
                colunaProfissao.textContent = pessoa.profissao;
  
                linha.appendChild(colunaNome);
                linha.appendChild(colunaIdade);
                linha.appendChild(colunaProfissao);
  
                tabela.appendChild(linha);
            });
          } catch (err) {console.log(err) }
      }

     preencherTabela();

Can anyone point me to a solution?

where does pessoas come from and is it a valid object?

also try opening the Debug window and see if you get any error messages under console tab

1 Like

@Maher , I edited and added the rest of the code in the post, as for the console, it actually pointed out an error to me, which did not occur in version 4 of the manifest, I corrected it and everything worked perfectly. Thanks. :handshake:

1 Like

glad things worked!

sharing the solution when possible might help others solve their own issues.

I encourage you to share the cause/solution if you can.

1 Like

@Maher Perfect placement
The cause of the error:
I used one of the Developer Tools templates, because it is about some studies that I am doing, I added all the html and js codes only in the Index.htm file and I had forgotten to delete the codes from the Index.js
Captura de tela 2023-03-03 085205
The curious thing is that in manifest 4 this error did not occur.

1 Like