1

While running the below code

let convertApi = ConvertApi.auth({secret: '<YOUR_SECRET>'})
let elResult = document.getElementById('result')
let elResultLink = document.getElementById('resultLink')
elResult.style.display = 'none'

in index.js it is showing an error as ConvertApi.auth is not defined. How to resolve this?

The error code is:

let convertApi = ConvertApi.auth({secret: 'secret key'})
                 ^

ReferenceError: ConvertApi is not defined
Aravinda KS
  • 187
  • 1
  • 16
  • Make sure that library is loaded prior usage. – Jonas Jun 23 '21 at 10:08
  • @Jonas Yes i have added import ConvertApi from 'convertapi'. But it is showing import ConvertApi from 'convertapi'; ^^^^^^ SyntaxError: Cannot use import statement outside a module. like this – Aravinda KS Jun 24 '21 at 11:20
  • Please add more information about how the library is included in your project. – Jonas Jun 28 '21 at 05:55

0 Answers0