Reputation: 157
Here is my test import I use in App.js
import {test} from './utils/configs';
Here is my ./utils/configs:
export const test = 'test-string'
App.js and Utils folder are in a same level. IDE finds import perfectly, but Xcode simulator throws error:
Unable to resolve module ./utils/configs
from /Users/riku/Documents/StreamrLabs/streamr-ios-location-poc/App.js
: The module ./utils/configs
could not be found from /Users/riku/Documents/StreamrLabs/streamr-ios-location-poc/App.js
. Indeed, none of these files exist:
/Users/User/Documents/Folder/projectname/utils/configs(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)
/Users/User/Documents/Folder/projectname/utils/configs/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)
It seems that importing new modules breaks Xcode/bundler. My app is detatched expo app.
Upvotes: 0
Views: 172
Reputation: 2719
Files should have an extension ! (configs.js in this case).
Xcode is trying to find .js files, and here, there is no extension !
(solution for record)
Upvotes: 2