I tried to import googleapis
and use it in my Forge app, but I got a deployment error like the below:
Error: Deployment failed
at ArtifactDeployer.handleErrorEvent (C:\Users\Leo\AppData\Roaming\npm\node_modules\@forge\cli\out\deploy\deployer\deployer.js:151:15)
at ArtifactDeployer.pollAndCheckEvents (C:\Users\Leo\AppData\Roaming\npm\node_modules\@forge\cli\out\deploy\deployer\deployer.js:61:18)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async ArtifactDeployer.monitorDeployment (C:\Users\Leo\AppData\Roaming\npm\node_modules\@forge\cli\out\deploy\deployer\deployer.js:72:28)
at async ArtifactDeployer.deploy (C:\Users\Leo\AppData\Roaming\npm\node_modules\@forge\cli\out\deploy\deployer\deployer.js:36:9)
at async PackageUploadDeployCommand.execute (C:\Users\Leo\AppData\Roaming\npm\node_modules\@forge\cli\out\deploy\package-upload-deploy.js:14:9)
at async CommandLineUI.displayProgress (C:\Users\Leo\AppData\Roaming\npm\node_modules\@forge\cli\node_modules\@forge\cli-shared\out\ui\command-line-ui.js:44:28)
at async DeployView.reportDeploymentProgress (C:\Users\Leo\AppData\Roaming\npm\node_modules\@forge\cli\out\command-line\view\deploy-view.js:32:24)
at async DeployController.run (C:\Users\Leo\AppData\Roaming\npm\node_modules\@forge\cli\out\command-line\controller\deploy-controller.js:70:27)
at async Command.actionProcessor (C:\Users\Leo\AppData\Roaming\npm\node_modules\@forge\cli\out\command-line\command.js:74:32)
Here’s my code:
import { google } from 'googleapis';
...
const { client_secret, client_id, redirect_uris } = cred.installed;
const oAuth2Client = new google.auth.OAuth2(
client_id,
client_secret,
redirect_uris[0]
);
...
App details:
- Jira product-trigger
- Node.js version tried: v16.2.0, v14.17.0, v14.15.0, v14.0.0
- Dependencies: @forge/api, @forge/ui, googleapis, moment-timezone
Note: The app works perfectly without using googleapis
.