Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

132
Visualizações
React native throws an error inside try {}

I installed RNUI to a fresh Expo project. After simply importing the module it throws this error:

Error: Problem validating fields in app.json. See https://docs.expo.io/workflow/configuration/
 • should NOT have additional property 'nodeModulesPath'.
Failed building JavaScript bundle.
Unable to resolve module react-native-haptic-feedback from /Users/xx/Documents/yy/zz/node_modules/react-native-ui-lib/src/optionalDependencies/HapticFeedbackPackage.js: react-native-haptic-feedback could not be found within the project.

If you are sure the module exists, try these steps:
 1. Clear watchman watches: watchman watch-del-all
 2. Delete node_modules and run yarn install
 3. Reset Metro's cache: yarn start --reset-cache
 4. Remove the cache: rm -rf /tmp/metro-*
  2 |
  3 | try {
> 4 |   HapticFeedbackPackage = require('react-native-haptic-feedback').default;
    |                                    ^
  5 | } catch (error) {}
  6 |
  7 | export default HapticFeedbackPackage;

It seems very illogical to me that it throws an error inside a try {} statement. The same module worked fine in an older Expo project (older version).

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You need to install react-native-haptic-feedback this package, and then to it doesn't work perform the steps given below.

Delete the node_modules folder in the project directory, close the metro bundler and everything that is running for the project. Now run npm install it should work.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda