1
resposta

Erro npm start

Toda vez que dou npm start aparece esse erro

Compiled with warnings.

./src/App.js Line 17: The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md jsx-a11y/anchor-is-valid Line 20: The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md jsx-a11y/anchor-is-valid Line 21: The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md jsx-a11y/anchor-is-valid Line 22: The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md jsx-a11y/anchor-is-valid

Search for the keywords to learn more about each warning. To ignore, add // eslint-disable-next-line to the line before.

o código que estou utilizando é o que esta disponível para download no fim do módulo.

1 resposta

Essa mensagem pode aparecer se você tiver em seu layout algo assim:

<a href="#">Clique aqui</a>

Essa mensagem de alerta avisa que o href="#" não é considerado um endereço válido. A sugestão da mensagem é trocar por um button, ou desativar o warning gerado pelo eslint.

Se você trocar o href="#" por href="/", vai perceber que este tipo de aviso vai desaparecer.

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