You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using VSCode with ESLint & TypeScript enabled, I am trying to write a function that takes the results of defineSecret() and does some processing on it to reduce code duplication across my project. The issue is that the datatype returned, SecretParam, is not exported.
Module '"firebase-functions/params"' declares 'SecretParam' locally, but it is not exported.ts(2459)
index.d.ts(5, 67): 'SecretParam' is declared here.
TSC errors out with:
error TS2459: Module '"firebase-functions/params"' declares 'SecretParam' locally, but it is not exported.
Relevant Code:
The code below is throwing ESLint errors and fails to compile with tsc:
import{SecretParam}from'firebase-functions/params';exportconstsafeGetConfigJsonVal=(secretKey: SecretParam): Record<string,any>=>{if(!secretKey.value()){thrownewError('secretKey.value() is null/undefined');}letmyConfig;try{myConfig=JSON.parse(secretKey.value());returnmyConfig;}catch(ex){thrownewError(`secretKey is not a valid JSON string: ${secretKey.value()}`);}};
Workaround:
Put // @ts-ignore on the line immediately before the import line
The text was updated successfully, but these errors were encountered:
Describe your environment
Describe the problem
Using VSCode with ESLint & TypeScript enabled, I am trying to write a function that takes the results of
defineSecret()
and does some processing on it to reduce code duplication across my project. The issue is that the datatype returned,SecretParam
, is not exported.When trying:
VSCode reports:
TSC errors out with:
Relevant Code:
The code below is throwing ESLint errors and fails to compile with
tsc
:Workaround:
Put
// @ts-ignore
on the line immediately before theimport
lineThe text was updated successfully, but these errors were encountered: