facebook / metro

🚇 The JavaScript bundler for React Native
https://metrobundler.dev
MIT License
5.17k stars 614 forks source link

`reporter.update` config not working #332

Open vjpr opened 5 years ago

vjpr commented 5 years ago

Maybe something to do with https://github.com/facebook/metro/blob/5a770dd48a3290b3ad01298a31c2a558823a5117/packages/metro-config/src/loadConfig.js#L216

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

Set reporter.update in rn-cli.config.js and then run a build.

If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can yarn install and yarn test.

What is the expected behavior?

Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.

rafeca commented 5 years ago

Thanks for reporting @vjpr !

Yeah, the line you're linking seems to be wrong (I think it was an artifact created when we refactored the config system of metro).

Are you interested on sending a PR to fix this? 😃

andrewhamon commented 6 months ago

Dropping by to say this still seems to be an issue in 2024. reporter is still documented however it does not seem to do anything. It seems like the reporter is simply hardcoded as the TerminalReporter without any consideration for what is configured.

barrelmaker commented 5 months ago

Also experiencing this, since updating to Expo SDK 50 this no longer works for me. Before I updated whenever a file was changed (saved) in our monorepo we had custom functionality on the module.reporter.update(...) function, but no longer.

Would love any ideas!

lgibso34 commented 3 months ago

Yeah it gets overwritten with react-native start here: https://github.com/facebook/react-native/blob/0384caad3458f7658e68653a0ab62fd6cc3e4483/packages/community-cli-plugin/src/commands/start/runServer.js#L148

Code for metro is all over the place in many repos.

effektsvk commented 1 month ago

I also stumbled upon this while using React Native UI Kitten. They are using reporter for running some script that generates some JSON files when Metro starts, but it's not running because the reporter seems to be overwritten.

https://akveo.github.io/react-native-ui-kitten/docs/guides/improving-performance