WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

bug?: import.meta.env.VAR does not work #272

@vladimirleonidovich

Description

@vladimirleonidovich

What version of HonoX are you using?

0.1.40

What steps can reproduce the bug?

Create .env.local with the following contents:

DB_PASSWORD="secret"

Create simple console.log in / route like this:

console.log(import.meta.env.DB_PASSWORD)

What is the expected behavior?

secret gets printed.

What do you see instead?

undefined gets printed.

Additional information

VITE_ prefixed environment variables are created to be exposed in client code so prefixing DB_PASSWORD with VITE_ would be a bad idea but in this case I have to. So I guess it’s bug?

https://vite.dev/guide/env-and-mode.html#env-variables

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions