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
In the blog example you can use getMiniflareBindings() to get access to the global env variables. I am trying to do the same thing in my project but can't replicate the functionality.
bindings.d.ts file:
export interface Bindings {
ENV: string
MYSQL_URL: string
JWT_SECRET: string
JWT_ACCESS_EXPIRATION_MINUTES: number
JWT_REFRESH_EXPIRATION_DAYS: number
JWT_RESET_PASSWORD_EXPIRATION_MINUTES: number
JWT_VERIFY_EMAIL_EXPIRATION_MINUTES: number
}
declare global {
function getMiniflareBindings(): Bindings
}
Trying to use it:
const env = getMiniflareBindings()
Error:
ReferenceError: getMiniflareBindings is not defined
In the blog example you can use
getMiniflareBindings()
to get access to the global env variables. I am trying to do the same thing in my project but can't replicate the functionality.bindings.d.ts file:
Trying to use it:
const env = getMiniflareBindings()
Error:
ReferenceError: getMiniflareBindings is not defined
build.js:
import { build } from 'esbuild'
tsconfig.json:
Any idea what I am doing wrong?
The text was updated successfully, but these errors were encountered: