Description
After bumping react-native-builder-bob in Reanimated monorepo, our example app using Next stopped building with a very obscure error.
Errors screenshots


Obviously this file doesn't have any instances of global and it worked well before the bump.
After investigation turns out the culprit is enforced addition of package.json into the build directory added in
I don't exactly understand why is that causing the error, especially that the error message and the callstack itself don't provide any useful information.
Packages
Selected options
{ "source": "src",
"output": "lib",
"targets": [
"module",
"typescript"
]
}
Link to repro
https://github.com/software-mansion/react-native-reanimated/tree/main/apps/next-example
Environment
Irrelevant, since it breaks in GitHub actions as well.
Description
After bumping
react-native-builder-bobin Reanimated monorepo, our example app using Next stopped building with a very obscure error.Errors screenshots
Obviously this file doesn't have any instances of
globaland it worked well before the bump.After investigation turns out the culprit is enforced addition of
package.jsoninto the build directory added inI don't exactly understand why is that causing the error, especially that the error message and the callstack itself don't provide any useful information.
Packages
Selected options
{ "source": "src", "output": "lib", "targets": [ "module", "typescript" ] }Link to repro
https://github.com/software-mansion/react-native-reanimated/tree/main/apps/next-example
Environment
Irrelevant, since it breaks in GitHub actions as well.