10 Feb 2022 - Forge CLI version 3.0.0

:tada: Updated CLI scopes error handling

If you previously experienced an error when attempting to update the scopes of your app, this release includes a fix for that error.

:tada: New bundler for Forge CLI

We upgraded our bundler to use webpack version 5.66.0.

:tada: CLI unsupported node version warning

Forge CLI will now display a warning when it is installed or used with an unsupported Node version.

:tada: Updated CLI linting exit status

We’ve made some changes to the way that forge lint handles errors and warnings. The linter now only exits with a status of 1 if there are errors. If there are only warnings present the linter exits normally.

:tada: New password input type support for TextField UI Kit component

The UI kit TextField component now supports “password” as an input type.

Run npm install -g @forge/cli@latest on the command line to install the latest version of @forge/cli .

7 Likes

Just upgraded to CLI 3.0.0 :fireworks:

Running forge lint returns the following warning:

% forge --version
3.0.0
% forge lint
The linter checks the app code for known errors. Warnings are issues you should fix, but they won't stop the app code from building.
Press Ctrl+C to cancel.

manifest.yml
32:7    warning  There are deprecated scopes 'scopes' in the manifest.yml file: 'read:jira-user, read:jira-work, write:jira-work'. You need to update this app to use new scopes and remove the deprecated scopes. Learn more at: https://go.atlassian.com/forge-permissions.  valid-permissions-required

⚠ 1 issue (0 errors, 1 warning)
  Issue found is not automatically fixable with forge lint.

Here are the permission scopes from the manifest:

permissions:
  scopes:
    - 'storage:app'
    - 'read:jira-user'
    - 'read:jira-work'
    - 'write:jira-work'

To my understanding this is how the permission scopes should be setup and in line with https://developer.atlassian.com/platform/forge/manifest-reference/permissions/

@MatthewFreeman anything wrong with my setup?

1 Like

Another problem I came across with Forge CLI 3.0.0

% forge deploy -e development
Deploying your app to the development environment.
Press Ctrl+C to cancel.

Running forge lint...
1 issue found. Run forge lint to review the warnings.

✕ Deploying your app to development...

ℹ Packaging app files
ℹ Uploading app
ℹ Validating manifest
ℹ Snapshotting functions

Error: Error thrown in the snapshot context.
App code snapshot error: Snapshot error occurred: Error: out is not a constructor
Learn more about the snapshot context at https://go.atlassian.com/forge-snapshot-context.

Rerunning the command with --verbose may give more details.

Following the advice and running with --verbose returns:


ℹ Validating manifest
  Upload URL is valid
  Found manifest file
  Manifest is a valid YAML
  Manifest passed common validations
  Manifest doesn't have forbidden modules
  Manifest passed function names validations
  Manifest passed cleanup function validation
ℹ Snapshotting functions
  Snapshot error occurred: Error: out is not a constructor
Validation errors: {
  "stack": [
    "Error: Snapshot error occurred: Error: out is not a constructor",
    "    at /var/task/index.js:66073:27",
    "    at async Promise.all (index 0)",
    "    at async Snapshotter.snapshot (/var/task/index.js:66059:13)",
    "    at async RuntimeInvocationProcessor.run (/var/task/index.js:65936:24)",
    "    at async RuntimeInvocationProcessor.processNextInvocation (/var/task/index.js:65904:28)",
    "    at async processEventLoop (/var/task/index.js:65873:9)"
  ]
}

Error: Error thrown in the snapshot context.
App code snapshot error: Snapshot error occurred: Error: out is not a constructor
Learn more about the snapshot context at https://go.atlassian.com/forge-snapshot-context.

Error: Error thrown in the snapshot context.
App code snapshot error: Snapshot error occurred: Error: out is not a constructor
Learn more about the snapshot context at https://go.atlassian.com/forge-snapshot-context.
    at ArtifactDeployer.handleErrorEvent (/Users/bjornbrynjar/.nvm/versions/node/v12.22.9/lib/node_modules/@forge/cli/out/deploy/deployer/deployer.js:127:23)
    at ArtifactDeployer.pollAndCheckEvents (/Users/bjornbrynjar/.nvm/versions/node/v12.22.9/lib/node_modules/@forge/cli/out/deploy/deployer/deployer.js:61:18)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async ArtifactDeployer.monitorDeployment (/Users/bjornbrynjar/.nvm/versions/node/v12.22.9/lib/node_modules/@forge/cli/out/deploy/deployer/deployer.js:72:28)
    at async ArtifactDeployer.deploy (/Users/bjornbrynjar/.nvm/versions/node/v12.22.9/lib/node_modules/@forge/cli/out/deploy/deployer/deployer.js:36:9)
    at async PackageUploadDeployCommand.execute (/Users/bjornbrynjar/.nvm/versions/node/v12.22.9/lib/node_modules/@forge/cli/out/deploy/package-upload-deploy.js:14:9)
    at async CommandLineUI.displayProgress (/Users/bjornbrynjar/.nvm/versions/node/v12.22.9/lib/node_modules/@forge/cli/node_modules/@forge/cli-shared/out/ui/command-line-ui.js:44:28)
    at async DeployView.reportDeploymentProgress (/Users/bjornbrynjar/.nvm/versions/node/v12.22.9/lib/node_modules/@forge/cli/out/command-line/view/deploy-view.js:50:24)
    at async DeployController.run (/Users/bjornbrynjar/.nvm/versions/node/v12.22.9/lib/node_modules/@forge/cli/out/command-line/controller/deploy-controller.js:122:27)
    at async Command.actionProcessor (/Users/bjornbrynjar/.nvm/versions/node/v12.22.9/lib/node_modules/@forge/cli/out/command-line/command.js:76:32) 

Is this a problem with CLI 3.0.0 or something in my environment?

@MatthewFreeman this means CLI 3.0.0 doesn’t allow us to deploy new versions and we can’t move back to previsous versions - meaning development is stopped until this is fixed.

1 Like

Have you tried deactivating snapshots in the manifest?

app:
  runtime:
    snapshots: false

this may be a temporary solution.

1 Like

I second that. This might be the same issue as here: Temporary issues with deploying and listing Forge apps

Thanks @a.yessipovskiy!

You right disabling snapshots works brilliantly! :wink: :raised_hands:

Glad to hear that worked for you. The question is only what are the drawbacks of deactivating the snapshots. I would really like to have a comment from Atlassian on that.

1 Like

Update… No development possible on Forge since CLI 3.0.0 doesn’t work and running previous CLI versions is not possible

Disabling the snapshots allows me to run “forge deploy” successfully.

However the app doesn’t load anymore:

Looking at the “forge tunnel” logs these are the errors:

=== Bundling code...
App code bundled.
App code reloaded.

Listening for requests...

Received proxy request. Serving file index.html for resource main from specified address http://localhost:8002

invocation: a59d61d7fe519a21 index.handler

invocation: e5a413353a13c50e index.handler

invocation: d963e8c6a7e21e26 index.handler

invocation: cb8290534293955c index.handler
ERROR   11:25:47.838  a59d61d7fe519a21  TypeError: out is not a constructor
    at index.js:34286:18
    at index.js:35210:3
    at index.js:35215:12
    at (<isolated-vm boundary>)
    at compileAndRun (/tunnel/node_modules/@forge/runtime/out/sandbox-isolate/index.js:71:22)
ERROR   11:25:47.879  e5a413353a13c50e  TypeError: out is not a constructor
    at index.js:34286:18
    at index.js:35210:3
    at index.js:35215:12
    at (<isolated-vm boundary>)
    at compileAndRun (/tunnel/node_modules/@forge/runtime/out/sandbox-isolate/index.js:71:22)

Can someone from Atlassian comment on this @MatthewFreeman @XavierCaron maybe?

Why can’t I run CLI 2.0.7 while these problems are being resolved?


Warning: Your version of Forge CLI is out of date. We recommend you update to the latest version to get the latest features and bug fixes.

Run npm uninstall -g @forge/cli followed by npm install -g @forge/cli to update from version 2.0.7 to 3.0.0.

Deploying your app to the development environment.

Press Ctrl+C to cancel.

Running forge lint...

1 issue found. Run forge lint to review the warnings.

Error: Your version of Forge CLI is no longer supported.

Run npm uninstall -g @forge/cli followed by npm install -g @forge/cli to update to the latest version.```
2 Likes

forge tunnel does not work with runtime snapshots property true

Get this:

=== Bundling code...
App code bundled.

=== Snapshotting functions...

#
# Fatal error in , line 0
# Check failed: (backing_store) != nullptr.
#
#
#
#FailureMessage Object: 0x7fff543be400
 1: 0xaa8321  [node]
 2: 0x1a46f04 V8_Fatal(char const*, ...) [node]
 3: 0x11108ec bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
 4: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
 5: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
 6: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
 7: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
 8: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
 9: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
10: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
11: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
12: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
13: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
14: 0x1110bd6 v8::internal::Deserializer::ReadObject(v8::internal::SnapshotSpace) [node]
15: 0x1110446 bool v8::internal::Deserializer::ReadData<v8::internal::FullMaybeObjectSlot>(v8::internal::FullMaybeObjectSlot, v8::internal::FullMaybeObjectSlot, v8::internal::SnapshotSpace, unsigned long) [node]
16: 0x1110a34 v8::internal::Deserializer::DeserializeDeferredObjects() [node]
17: 0x110af6c v8::internal::ContextDeserializer::Deserialize(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSGlobalProxy>, v8::DeserializeInternalFieldsCallback) [node]
18: 0x110b774 v8::internal::ContextDeserializer::DeserializeContext(v8::internal::Isolate*, v8::internal::SnapshotData const*, bool, v8::internal::Handle<v8::internal::JSGlobalProxy>, v8::DeserializeInternalFieldsCallback) [node]
19: 0x1131b6a v8::internal::Snapshot::NewContextFromSnapshot(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSGlobalProxy>, unsigned long, v8::DeserializeInternalFieldsCallback) [node]
20: 0xe32d98 v8::internal::Genesis::Genesis(v8::internal::Isolate*, v8::internal::MaybeHandle<v8::internal::JSGlobalProxy>, v8::Local<v8::ObjectTemplate>, unsigned long, v8::DeserializeInternalFieldsCallback, v8::MicrotaskQueue*) [node]
21: 0xe33148 v8::internal::Bootstrapper::CreateEnvironment(v8::internal::MaybeHandle<v8::internal::JSGlobalProxy>, v8::Local<v8::ObjectTemplate>, v8::ExtensionConfiguration*, unsigned long, v8::DeserializeInternalFieldsCallback, v8::MicrotaskQueue*) [node]
22: 0xbcfa8e v8::NewContext(v8::Isolate*, v8::ExtensionConfiguration*, v8::MaybeLocal<v8::ObjectTemplate>, v8::MaybeLocal<v8::Value>, unsigned long, v8::DeserializeInternalFieldsCallback, v8::MicrotaskQueue*) [node]
23: 0xbd00a4 v8::Context::New(v8::Isolate*, v8::ExtensionConfiguration*, v8::MaybeLocal<v8::ObjectTemplate>, v8::MaybeLocal<v8::Value>, v8::DeserializeInternalFieldsCallback, v8::MicrotaskQueue*) [node]
24: 0x7f77edc31534 ivm::IsolateEnvironment::NewContext() [/tunnel/node_modules/@forge/isolated-vm/build/Release/isolated_vm.node]
25: 0x7f77edc326fd ivm::IsolateEnvironment::IsolateCtor(unsigned long, std::shared_ptr<v8::BackingStore>, unsigned long) [/tunnel/node_modules/@forge/isolated-vm/build/Release/isolated_vm.node]
26: 0x7f77edc60be9 ivm::IsolateHandle::New(v8::MaybeLocal<v8::Object>) [/tunnel/node_modules/@forge/isolated-vm/build/Release/isolated_vm.node]
27: 0x7f77edc68a45 ivm::ConstructorFunction<std::unique_ptr<ivm::ClassHandle, std::default_delete<ivm::ClassHandle> > (*)(v8::MaybeLocal<v8::Object>), &ivm::IsolateHandle::New>::Entry(v8::FunctionCallbackInfo<v8::Value> const&) [/tunnel/node_modules/@forge/isolated-vm/build/Release/isolated_vm.node]
28: 0xc272e5  [node]
29: 0xc278ef  [node]
30: 0xc27f16 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [node]
31: 0x1448ef9  [node]

What node version are you using?

@bentley this one:

% node --version
v12.22.9

:thinking: I’ve bumped mine back to that and can deploy without issue (with snapshots off and on). Though the app I have isn’t doing a ton.

Curious - does bumping node up to a recent version do anything? The documentation says that 10+ should be supported (and this CLI update should yell at you if using an unsupported version: Forge CLI will now display a warning when it is installed or used with an unsupported Node version. But worth giving it a try?

Ok, I had some changes in progress when I left yesterday, once I started again this morning I got the update CLI message - and was unable to run the app.

After reviewing the console logs it seems the problem is related the changes I had in progress and not the CLI. I will investigate further and confirm.

Thanks @bentley!

1 Like

We’re having this issue as well. Completely blocked with progressing updates for any of the Forge apps

2 Likes

Seems the problem is not on my end. I have updated node to:

node --version
v12.22.10

The problem occurs when the front end invokes the first back-end method. Console errors from the call:

readGameInfo error:  Error: There was an error invoking the function - Function with handler "index.handler" was not found
    at invoke (https://jira-frontend-static.prod.public.atl-paas.net/assets-brotli/async-forge-ui-iframe.250768f8bb4e02c9f60d.8.js:259:862)
    at async https://jira-frontend-static.prod.public.atl-paas.net/assets-brotli/async-forge-ui-iframe.250768f8bb4e02c9f60d.8.js:238:273

Error: There was an error invoking the function - Function with handler "index.handler" was not found
    at hn.error (https://forge.cdn.prod.atlassian-dev.net/global-bridge.js:1:19406)
    at Object.<anonymous> (https://forge.cdn.prod.atlassian-dev.net/global-bridge.js:1:27179)
    at JSON.parse (<anonymous>)
    at o (https://forge.cdn.prod.atlassian-dev.net/global-bridge.js:1:27038)
    at jn (https://forge.cdn.prod.atlassian-dev.net/global-bridge.js:1:27191)
    at Tn.u.on (https://forge.cdn.prod.atlassian-dev.net/global-bridge.js:1:31851)
    at Tn (https://forge.cdn.prod.atlassian-dev.net/global-bridge.js:1:31988)
    at https://forge.cdn.prod.atlassian-dev.net/global-bridge.js:1:37974
    at Function.n.try (https://forge.cdn.prod.atlassian-dev.net/global-bridge.js:1:10458)
    at https://forge.cdn.prod.atlassian-dev.net/global-bridge.js:1:37771
    at r (https://forge.cdn.prod.atlassian-dev.net/global-bridge.js:1:38023)
console.<computed> @ index.js:1

Notice - there are no changes in the manifest or the function being called from both sides - so it seems the problem is with CLI 3.0.0.

@bentley can you enable previous versions of CLI because all development is stopped since CLI 3.0.0 and it seems I am not the only partner experiencing this problem.

I’m getting warnings about the scopes I’m using are deprecated - but when I go and look at the documentation it refers to - they’re not… #confused

3 Likes

Hi @bjornbrynjar @biro, are you using npm or yarn to install the CLI? We are working to narrow down the cause of this issue.

1 Like

Hi everyone, we have removed the restriction forcing developers to use @forge/cli@3.0.0, we would love if anyone who faced issues with 3.0.0 could leave a detailed report on the feedback board.

2 Likes

Thanks @SamSmyth!

I am using npm. What else do you need?

%npm version
{
  npm: '6.14.16',
  ares: '1.18.1',
  brotli: '1.0.9',
  cldr: '37.0',
  http_parser: '2.9.4',
  icu: '67.1',
  llhttp: '2.1.4',
  modules: '72',
  napi: '8',
  nghttp2: '1.41.0',
  node: '12.22.10',
  openssl: '1.1.1m',
  tz: '2021a4',
  unicode: '13.0',
  uv: '1.40.0',
  v8: '7.8.279.23-node.56',
  zlib: '1.2.11'
}

v12.22.1 for my node version