Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Native v0.60.4 #8

Open
quickyapp opened this issue Jul 20, 2019 · 2 comments
Open

React Native v0.60.4 #8

quickyapp opened this issue Jul 20, 2019 · 2 comments

Comments

@quickyapp
Copy link

Not working with the newest Version of RN..
Upgraded the demo project to v0.60.4 and got this error:

Unable to resolve module ./src/myMarkdownResource.md from /Users/****/Downloads/React-Native-Local-Resource-master/demo_project/App.js: The module ./src/myMarkdownResource.md could not be found from /Users/****/Downloads/React-Native-Local-Resource-master/demo_project/App.js. Indeed, none of these files exist:

  • /Users/****/Downloads/React-Native-Local-Resource-master/demo_project/src/myMarkdownResource.md(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)
  • /Users/****/Downloads/React-Native-Local-Resource-master/demo_project/src/myMarkdownResource.md/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)

RCTFatal
__28-[RCTCxxBridge handleError:]_block_invoke
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_main_queue_callback_4CF
CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE
__CFRunLoopRun
CFRunLoopRunSpecific
GSEventRunModal
UIApplicationMain
main
start
0x0

@bryaneaton13
Copy link

I had to extend my metro config using the defaults. I found the answer here:
facebook/metro#367 (comment)

const metroDefault = require('metro-config/src/defaults/defaults.js');

module.exports = {
    resolver: {
        assetExts: metroDefault.assetExts.concat(['md']),
    },
};

@kkirby
Copy link

kkirby commented Feb 4, 2020

A bit better solution code-wise:

const {getDefaultConfig} = require('metro-config');
const defaultConfig = getDefaultConfig.getDefaultValues(__dirname);

module.exports = {
    resolver: {
        assetExts: [...defaultConfig.resolver.assetExts, 'md']
    }
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants