2
respostas

Erro ao inserir imagem

Alguém sabe como resolver esse erro quando insiro imagem?

error: ReferenceError: SHA-1 for file C:\Users\marcus.jesus\Documents\React Native\Instalurav4\res\img\alura.jpg (C:\Users\marcus.jesus\Documents\React Native\Instalurav4\res\img\alura.jpg) is not computed
    at DependencyGraph.getSha1 (C:\Users\marcus.jesus\Documents\React Native\Instalurav4\node_modules\metro\src\node-haste\DependencyGraph.js:263:13)
    at C:\Users\marcus.jesus\Documents\React Native\Instalurav4\node_modules\metro\src\DeltaBundler\Transformer.js:211:26
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (C:\Users\marcus.jesus\Documents\React Native\Instalurav4\node_modules\metro\src\DeltaBundler\Transformer.js:46:24)
    at _next (C:\Users\marcus.jesus\Documents\React Native\Instalurav4\node_modules\metro\src\DeltaBundler\Transformer.js:66:9)
    at C:\Users\marcus.jesus\Documents\React Native\Instalurav4\node_modules\metro\src\DeltaBundler\Transformer.js:71:7
    at new Promise (<anonymous>)
    at C:\Users\marcus.jesus\Documents\React Native\Instalurav4\node_modules\metro\src\DeltaBundler\Transformer.js:63:12
    at Transformer.transformFile (C:\Users\marcus.jesus\Documents\React Native\Instalurav4\node_modules\metro\src\DeltaBundler\Transformer.js:236:7)
    at C:\Users\marcus.jesus\Documents\React Native\Instalurav4\node_modules\metro\src\Bundler.js:87:34

O meu código tá assim:

/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 * @flow strict-local
 */

import React, {Fragment} from 'react';
import {Text, Image, ScrollView} from 'react-native';

const App = () => {
  return (
    <ScrollView> 
      <Text>Marcus Azevedo</Text>
      <Image 
        source={require("./res/img/alura.jpg")}
        style={{
          width:100,
          heidht:100
        }}
      />
      <Text>Maria da Silva</Text>
      <Image source={require("./res/img/alura.jpg")}/>
    </ScrollView> 
  );
};

export default App;
2 respostas

Oi Marcus, tdo bom? Vc instalou o React-native usando o Expo ou fez a instalação que sugerimos no curso?

Caro professor, fiquei esperando a resposta por duas semanas. Já desisti do curso. Obrigado.