Does not work with customized project root
See original GitHub issueHiya, I have a RN 0.59.2 project with config that looks like this:
const path = require("path");
const { getDefaultConfig } = require("metro-config");
module.exports = (async () => {
const {
resolver: { sourceExts, assetExts }
} = await getDefaultConfig();
return {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false
}
}),
babelTransformerPath: require.resolve("react-native-svg-transformer")
},
resolver: {
assetExts: assetExts.filter(ext => ext !== "svg"),
sourceExts: [...sourceExts, "svg"],
extraNodeModules: {
shared: path.resolve(__dirname, "../shared")
}
},
// Move the project root up a level so we can access /shared, otherwise the packager can't access those assets.
projectRoot: path.resolve(__dirname, "../")
};
})();
I’m seeing the same issue from #14, but as far as I can tell the only difference between our configs is the moved project root and extra node module. Any ideas?
Dependencies:
"react": "16.8.3",
"react-native": "^0.59.2",
"react-native-svg": "^9.3.7",
"react-native-svg-transformer": "^0.12.1",
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Gradle: getting the root project directory path when starting ...
I got past this problem by ensuring Java userDir was set to the project directory (i.e. project.projectDir ) at the top of my...
Read more >Content roots | IntelliJ IDEA Documentation - JetBrains
Create a content root for your project and configure a folder structure for your production code, your tests, and resource files.
Read more >Manage projects - GitLab Docs
Most work in GitLab is done in a project. Files and code are saved in projects, and most features are in the scope...
Read more >Custom Root Causes | BIM 360 - Autodesk Knowledge Network
Inactive custom root causes cannot be used in a new issue, but they remain part of issues they are currently assigned to.
Read more >IDE Features — Elpy 1.35.0 documentation
Set the current project root directory. This directory should contain all files related to the current project. elpy-project-ignored-directories (Customize ...
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 FreeTop 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
Top GitHub Comments
Following up on this, I was running my packager with
react-native start
. As it turns out, RNCLI does not care about metro.config.js when you run it this way. Mind boggling.Edit: Unless you pass --config metro.config.js Then it’ll load. Brilliant.
@AshwinMekala I’m trying to keep the README as clean as possible, and this seems to be either a bug in some version of React Native CLI, or related to some very specific configuration.
I need some kind of example/demo of the exact problem that helps me to verify it before it can be added to the README.