Error: Cannot read property 'type' of undefined - forge/cli v1.3.3

After upgrading to @forge/cli v1.3.3, I started seeing the following error on a TypeScript project:

$ ./node_modules/.bin/forge lint --verbose
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.

Error: Cannot read property 'type' of undefined

TypeError: Cannot read property 'type' of undefined
    at ExternalApiCallVisitor.visit (/<REPOSITORY_PATH>/associate-admin/node_modules/@forge/cli/node_modules/@forge/lint/out/lint/linters/permission-linter/visitors/external-fetch-call-visitor.js:22:38)

Is there anyone seeing the same symptom?
It seems related to the Fetch API.

Others have reported running into errors after upgrading to 1.3.3: Error: Cannot read property 'type' of undefined - forge/cli v1.3.3 Maybe related? Will dig more.


Thanks, @bentley. FYI - as v1.3.3 is required, this error blocks the deployment.

Hi @i05, we are working on a fix for the issue you are facing. In the meantime, you should still be able to deploy using the --no-verify flag with the deploy command.

We’ll let you know when we release a fix.


@i05 we’ve released @forge/cli@1.3.4 with the fix for this issue. Please let us know if this does not solve the problem you are facing!


I’ve verified now the forge lint command works as expected :100:

Hi @i05,

Just to follow up on this, we wanted to double check that the error case was exactly the error you encountered, and we haven’t missed anything.

Were you encountering the error because you had an empty fetch? i.e. api.fetch()

I’m not too sure about this. The sure thing is the error has been solved with 1.3.4. So what I can say is the cause can be something fixed between 1.3.3 and 1.3.4.