Skip to content

process and import are undefined in front end code #20071

@Nanome203

Description

@Nanome203

What version of Bun is running?

1.2.15+df017990a

What platform is your computer?

Linux 6.14.7-arch2-1 x86_64 unknown

What steps can reproduce the bug?

bunfig.toml:

[serve.static]
plugins = ["bun-plugin-tailwind"]
env = "BUN_PUBLIC_*"

Then add this to front end code and run

const HOST = process.env.BUN_PUBLIC_HOST_URL;
const PORT = import.meta.env.BUN_PUBLIC_PORT;

What is the expected behavior?

environment variables are read

What do you see instead?

process is undefined
hmr.importMeta.env is undefined

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bake:devhot-reloading dev server for client+server applicationsbugSomething isn't workingbundlerSomething to do with the bundler

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions