Erro conexão da aplicação com o back-end
19/05/2021
0
Estou tendo um problema de conexão da aplicação com o back-end. Uso o React Native com EXPO O erro ocorre em uma tela de login ao tentar fazer uma validação de usuário em um BD no sql-server Creio que o erro esteja nisso:
async function sendForm() {
let response = await fetch('http://192.168.0.17:3000/login'
porém, não sei o que pode estar errado... de repente está faltando algum módulo do Node.
já refiz o projeto
deletei node_modules e foz yarn install
já teste as rotas do Controller.js e estão funcionando.
imagens: https://ibb.co/B354qky https://ibb.co/ZRjKRnn https://ibb.co/pyDyM70
O ERRO é ESSE:
[Unhandled promise rejection: SyntaxError: JSON Parse error: Unrecognized token '<']
at [native code]:null in parse
at node_modules\react-native\node_modules\promise\setimmediate\core.js:37:13 in tryCallOne
at node_modules\react-native\node_modules\promise\setimmediate\core.js:123:24 in setImmediate$argument_0
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:130:14 in _callTimer
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:181:14 in _callImmediatesPass
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:441:30 in callImmediates
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:387:6 in __callImmediates
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:135:6 in __guard$argument_0
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:364:10 in __guardat node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:134:4 in flushedQueue
at [native code]:null in flushedQueue
at [native code]:null in invokeCallbackAndReturnFlushedQueue
async function sendForm() {
let response = await fetch('http://192.168.0.17:3000/login'
porém, não sei o que pode estar errado... de repente está faltando algum módulo do Node.
já refiz o projeto
deletei node_modules e foz yarn install
já teste as rotas do Controller.js e estão funcionando.
imagens: https://ibb.co/B354qky https://ibb.co/ZRjKRnn https://ibb.co/pyDyM70
O ERRO é ESSE:
[Unhandled promise rejection: SyntaxError: JSON Parse error: Unrecognized token '<']
at [native code]:null in parse
at node_modules\react-native\node_modules\promise\setimmediate\core.js:37:13 in tryCallOne
at node_modules\react-native\node_modules\promise\setimmediate\core.js:123:24 in setImmediate$argument_0
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:130:14 in _callTimer
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:181:14 in _callImmediatesPass
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:441:30 in callImmediates
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:387:6 in __callImmediates
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:135:6 in __guard$argument_0
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:364:10 in __guardat node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:134:4 in flushedQueue
at [native code]:null in flushedQueue
at [native code]:null in invokeCallbackAndReturnFlushedQueue
Renato Correia
Curtir tópico
+ 0
Responder
Clique aqui para fazer login e interagir na Comunidade :)