score:22
for me, the issue was that vscode had inserted some imports at the top of one of my js files. very odd. these were the lines:
import { tsconstructortype } from '@babel/types';
import { logger } from 'handlebars';
score:0
usually you can fix these surprise errors by clearing your cache. run $ expo start --clear
.
score:0
i had this error because i was trying to use dotenv when i should have been using one of these react-native specific packages. check that all your installed packages are compatible with react native.
score:0
i had exactly this issue. visual studio code users, autocomplete will sometimes auto-import modules you have no need for at the top of your file without you noticing. running git diff
revealed the following lines i had no memory of every writing at the top of a file i'd worked on:
+import { clearconfigcache } from 'prettier';
+import { createiconsetfromfontello } from 'react-native-vector-icons';
how to avoid:
run git diff
and read every single line that follows. the offenders will usually turn up.
score:0
if you are importing a module (a functional/class component from another file) in expo react native, be sure to mention "./" in the assets array of the rnpm object in the package.json file like this:
"rnpm": {
"assets": [
"./"
]
}
do not try to install "fs" module separately, it would give more errors.
score:0
my auto-suggestion accidentally imported this in my file which caused the same problem.
import { status } from "express/lib/response";
i removed and it worked. try to find something in import that should not be there like from backend imports.
score:6
one of my node modules is depending on react-native-dotenv, but its code was using old import like import {} from 'react-native-dotenv'
.
but latest version of dotenv is using import {} from '@env'
.
fixing this import in the module resolved the problem.
Source: stackoverflow.com
Related Query
- react native sudden Unable to resolve module `fs` error
- Error: Unable to resolve module `buffer` React Native
- React native Typescript path alias unable to resolve module
- React Native Error Cannot find module 'metro-config/src/defaults/blacklist'
- Module not found: Can't resolve 'react-native' - React Native
- How to resolve module name conflict in react native
- React Native Test Error - Unable to find node on an unmounted component
- How to fix React Native error "jest-haste-map: Haste module naming collision"?
- React native :Unable to resolve module Indeed, none of these files exist:
- Cannot resolve module while trying to organize modules in React Native
- How to fix unable to resolve module react redux hooks\useDispatch?
- how to resolve React error Module build failed (from ./node_modules/babel-loader/lib/index.js):
- React Testing library custom setup import test-utils: module not installed. Unable to resolve path
- Module not found: Can't resolve ' ./Navbar' error when compiling in react
- How can I resolve this error " type is invalide" in react native
- Error Running React Native App From Terminal (iOS)
- React Native Error - yarn' is not recognized as an internal or external command
- How to fix this error : " Module not found :can't resolve popper.js "
- PhaseScriptExecution [CP-User] error in React Native
- Trouble requiring image module in React Native
- Error: Unable to resolve module `@react-native-community/toolbar-android`
- React unable to import component -- module not found
- Bundle error using webpack for Electron application `Cannot resolve module 'electron'`
- How to resolve "Animated: `useNativeDriver` is not supported because the native animated module is missing." in react-navigation?
- Minified React error #152 - how to resolve this?
- React Native on Ipad - Error - could not connect to development server
- React Native + Jest EMFILE: too many open files error
- Tailwind in React project - getting "Cannot find module 'autoprefixer'" error during setup
- React Native 0.31: Could not get BatchedBridge Error
- Material-ui response to breaking change in React 15.4.0? "Cannot resolve module 'react/lib/EventPluginHub'"
More Query from same tag
- How to display dropdown selected value in pdf using ReactToPrint plugin?
- React Hook useEffect has a missing dependency warning
- How to export all components in index.js?
- reactjs - unit testing with enzyme
- How can I set the state of my parent component from the child component when using react-router?
- React/Typescript - expects at least '3' arguments, but the JSX factory 'React.createElement' provides at most '2'. TS622
- I am getting this Error HH16: The directory C:\block\react-dapp contains files that could conflict: error when i run npx hardhat
- Queried parameter is null
- Nested Routing In React Router Dom issues
- Data from one JSON file is overwriting another JSON dataset when trying to use react-select module in a form in React
- ReactJS - Toggle state or property from mapped children components?
- name already exists regex
- Why value from a Material-UI Button is not being passed to the onClick event handler?
- Error: Actions must be plain objects. Use custom middleware for async actions. How to fix it?
- How to override this materialui style
- React .map renders whole array each time it is updated and causes duplication
- Redux- 'props' undefined using compose
- Generic API call using redux-middleware and redux-thunk
- how to make path for / and home in react router v6?
- Firebase - Facebook Auth
- How to parse Embeddable Links from Markdown and render custom React Components
- Render method does not re-render element initialized in the constructor
- Unable to get dynamic component in Next.js to skip server side rendering and show only on the client
- Migrating a React class component's state to a functional component
- How pass API info from a react component to another?
- Map return multi components
- Architecture in a react native app using WebSockets
- How can I mock a service within a React component to isolate unit tests in jest?
- React map function and CSS grid
- TypeError: Cannot read property 'map' of undefined, in react hooks crud application