-
Notifications
You must be signed in to change notification settings - Fork 1
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
metro.config.js #8
Comments
Hello! I probably won't have time to take a look at this issue until the weekend. Until then, if you can, and have some time to make a POC repository with the reproduction of this error, even if just bare-bones, it would help me immensely! I suppose the syntax is the same between P.S.: I haven't tested the helper with Expo. Perhaps it's time to actually add support for (and test against) it (or at the very least analyse the feasibility). |
Hi @flisboac, I've tried to use the helper with react-native. Due to limited time, I had to iterate quickly with I was doing, so I've used wml for the moment. Though, I'm still interested with symlinks rather than watching and copying actual files, therefore I opened this issue. By the way, later, I've also tried my luck with the new Expo SDK 33 and expo-yarn-workspaces and it took just 10 minutes to set it up. Still, it's expo and not react-native and I think a solution here will be valid for RN projects. Thanks for your time. |
@mehmetnyarar Thanks for clarifying. Although not ideal, I'm truly happy that you could find a solution to your problem (either with wml or expo, I'm not quite sure). But that doesn't mean I won't investigate the issue, I just need to find some time! In the meantime, I've been googling this SHA-1 error, and so far it seems to be related to file extensions (in your case, the JSON file), as per this issue: facebook/metro#176. Could you try something along the lines of the following, and tell me if it works? const defaultConfig = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
}
})
}
}
const projectRoot = __dirname
const metroConfigHelper = require('react-native-monorepo-helper').metroConfigHelper
const helperConfig = metroConfigHelper(projectRoot)
.typeScript(true)
.watchFolder("shared")
.defaultConfig({
port: 8081,
// Put here all of your extra asset/source-code extensions;
// it will be merged by the helper (including the ones necessary for
// TS support, if any)
assetExts: ["json"],
})
.generate()
module.exports = Object.assign({}, defaultConfig, helperConfig) If this works, perhaps the helper is including an empty array and overwriting the default extensions when it really shouldn't be (even though it's unlikely). If it doesn't, I'll need to re-study Metro, as it seems they have rewritten the way configuration loading works. If Or I could be wrong, and it's related to React Native 0.59 and all the changes it brought up, I'm not sure. :p |
@flisboac I received the same SHA error and tried your suggestion and it did not help. I may have a version mismatch though, I get a bunch of warnings about bad configuration values as well. |
@zachariahtimothy and @mehmetnyarar could you share a Unfortunately, I'm still a bit busy with my final project at university and some other urgent matters, so I don't know if I'll be able to give this issue the time it deserves. Also, I've been away from React altogether for some months now, so the solution may come later than I'd want it to... And for that, I'm sorry. I may have more free time by the end of the year. In any case, though I won't be able to go hands-on on this, if anyone wants to volunteer to tackle this problem, I'll be more than happy to help as much as I can! |
@flisboac Hi, did you check it, with new react native package. I am unable to make it work |
I'm submitting a ...
[x] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[x] question about how to use this project
Summary
I'm trying to make it work for the following RN project. As far as I read,
rn-cli.config.js
is replaced bymetro.config.js
, indeed setting uprn-cli
changes nothing.In
metro.config.js
, I did this:When I do
yarn start
, it seems the package finds theshared
package, but I get error during bundling:I've tried various alternatives in
metro.config.js
but it doesn't work so far...I have the following
package.json
at the root:The text was updated successfully, but these errors were encountered: