Can't import js file in parent folder
See original GitHub issueDescription
Can’t import js file in parent folder
Reproduction
import {ReactNativeCron} from ‘…/ReactNativeCron’ gives error:
Directory /Users/nikos/WebstormProjects/react-native-cron/ReactNativeCron doesn't exist
If I move the file to ./ReactNativeCron it works
-
React Native version: “react-native”: “0.40.0”
-
Platform: iOS
-
Operating System:MacOS
Issue Analytics
- State:
- Created 7 years ago
- Comments:33 (2 by maintainers)
Top Results From Across the Web
import files from parent/other directory in react - Stack Overflow
I want to import images from the images folder but I ran into an error Module not found: Error: Can't resolve '../assets/images/Web_SVG.svg'. My ......
Read more >Import From Parent Folder · Python Cook Book
When a module named spam is imported, the interpreter first searches for a built-in module with that name. If not found, it then...
Read more >import - JavaScript - MDN Web Docs - Mozilla
The static import declaration is used to import read-only live bindings which are exported by another module. The imported bindings are ...
Read more >Documentation - Module Resolution - TypeScript
A relative import is resolved relative to the importing file and cannot resolve ... Ask the folder /root/src/moduleB if it contains a file...
Read more >Python — How to Import Modules From Another Folder? - Finxter
For example, a module in the parent folder would be imported with from .. import module . The __init__.py file signals to Python...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@hnryjms and I ran in to this as well. It is an issue for us because our react-native app is a subdirectory of our repo that contains a web app and server code. We have a
lib
directory that contains useful JS code for all projects, and would like to be able to use it everywhere. We could make thelib
directory a local NPM module and install it into both projects, but that makes local development somewhat annoying.The solution we found was to add the file called
rn-cli.config.js
at the Mobile app’s root which is the default file the react-native packager looks at for specifying run configurations.Can someone reopen this ticket?