Closed tad3j closed 8 months ago
Any updates here?
You can currently work around it by creating a symlink, for example:
// File: <monorepo>/scripts/deploy-to-code-push.js
const appDir = join(__dirname, '../apps/app')
// AppCenter will try to use hermes-engine from the local node_modules
// instead of the hoisted one, so we create a symlink and it'll work
execSync(
'ln -sfr ../../node_modules/hermes-engine ./node_modules/hermes-engine',
{ cwd: appDir, stdio: 'inherit' },
)
execSync(
[
'npx',
'appcenter-cli',
'codepush',
'release-react',
`--app ${CODE_PUSH_APP}`,
'--deployment-name Default',
'--disable-duplicate-release-error',
'--target-binary-version "*"',
`--token ${APP_CENTER_ACCESS_TOKEN}`,
].join(' '),
{ cwd: appDir, stdio: 'inherit' },
)
any updates?
Hi @tad3j, could you please confirm what this issue still persist on latest version (8.2.1)? If no, cloud you please confirm what this workaround working for you?
Hello @tad3j, we haven't heard from you for a while, so I'm closing this issue. Please, feel free to reopen it in case of new information.
Steps to Reproduce
appcenter codepush release-react...
orgradlew assembleRelease
with hermes enabled)Expected Behavior
Code push CLI commands should work.
Actual Behavior
Code push CLI fails because it's looking for
node_modules
in wrong location.My folder structure: root_folder -node_modules -packages/mobile/node_modules
So CLI is looking for dependencies inside
root_folder/packages/mobile/node_modules
, but they are actually inroot_folder/node_modules
.Deploying
For deploying with code-push CLI I've used this workaround:
Exception for deploying without workaround above:
Building in Ubuntu (From Windows app store)
react-native solves this issue by providing config via build.gradle, so I was able to get react-native working with monorepo and hermes enabled, but I got stuck at code-push: https://github.com/react-native-community/cli/issues/877 Maybe code-push can use similar?
For build with hermes enabled I get this error:
...notice that it's looking for
node_modules
folder in wrong location.EDIT: I've also noticed that there is an extra double quote inside the path
node_modules"/react-native-code-push
and it may be failing because of that...but strangely this works on Windows (build succeeds with same files, including unchanged node_modules).Reproducible Demo
Since issue is obvious I didn't decide to create a repo with it yet, but if needed I can do it. As stated above, the only issue is in how folders are placed, so one can easily reproduce by putting his react-native files in a project sub folder (/packages/mobile/ in my case), but keeps node_modules folder in root directory (next to my packages directory).
Environment