Skip to content

Allow STORYBOOK as env var #1724

@snake-py

Description

@snake-py

Description

I am getting this error here:

error during build:
[vike:envVars] [vike][Wrong Usage] import.meta.env.STORYBOOK is used in client-side file /src/sentry/translation/utils.ts which means that the environment variable STORYBOOK will be included in client-side bundles and, therefore, STORYBOOK will be publicly exposed which can be a security leak. Use import.meta.env.STORYBOOK only in server-side files, or rename STORYBOOK to PUBLIC_ENV__STORYBOOK, see https://vike.dev/env
file: /Users/workdigital/work/hybrid-app/frontend2.0/src/sentry/translation/utils.ts
    at /Users/workdigital/work/hybrid-app/frontend2.0/node_modules/vike/dist/cjs/node/plugin/plugins/envVars.js:50:56
    at Array.forEach (<anonymous>)
    at Object.transform (/Users/workdigital/work/hybrid-app/frontend2.0/node_modules/vike/dist/cjs/node/plugin/plugins/envVars.js:36:18)
    at file:///Users/workdigital/work/hybrid-app/frontend2.0/node_modules/rollup/dist/es/shared/node-entry.js:19774:40

I know of the common prefix, however STORYBOOK is injected by the lib itself and I rather not make my own set up to detect if I run in storybook.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions