Get function id from other app

Hello, im creating a shopify discount function on my custom app (app1) by shopify app generate extension but always get this error npm exec --graphql-code-generator --config package.json. So I try to create new app and it works or even i copy extension from app2 to app1 and build, i still got above error. However, when i back to app1 and query shopifyFunctions to get its id and pass to discountCodeApp. Is that possible to get shopify function from app2 at app1 or anyway to fix above error



1 Like

Hey @BrownTheFlower :waving_hand: - thanks for reaching out, that does seem odd. Can you let me know if youโ€™ve taken a look at this issue in our CLI Github repo and if any of the solutions work for you?

If not, if youโ€™re able to share the verbose logs when you run shopify app generate --verbose here in the thread I can take a look on our end.

Hope this helps - feel free to ping me here if I can help out further :slight_smile:

I found my solution but it weird.

im using shopify app init then shopify app generate extension and it works. after that, i copy the extension on my source code but i cannot build or deploy cause the same error: npm exec --graphql-code-generator --config package.json.

after that, im cd to the function extension folder and install @shopify/cli and it can build normaly. im using pnpm

1 Like

Thanks for sharing your solution @BrownTheFlower, glad this is resolved! While we primarily test our CLI with npm/yarn (and the Shopify CLI app itself), really appreciate you sharing the solve for other folks who might need it.

Feel free to reach out if you run into any other issues! :blush:

1 Like