Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require is not defined in bun #19431

Closed
7 tasks done
huseeiin opened this issue Feb 15, 2025 · 0 comments
Closed
7 tasks done

require is not defined in bun #19431

huseeiin opened this issue Feb 15, 2025 · 0 comments

Comments

@huseeiin
Copy link

Describe the bug

require is defined in regular bun runtime

Reproduction

i can't install bun in stackblitz

Steps to reproduce

import { createServer } from "vite";

const { ssrLoadModule } = await createServer({
  server: { middlewareMode: true },
  appType: "custom",
});

await ssrLoadModule("/test.ts");

test.ts:

console.log(import.meta.env);

System Info

System:
    OS: Linux 6.8 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
    CPU: (4) x64 Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz
    Memory: 4.32 GB / 7.65 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 23.6.0 - ~/.nvm/versions/node/v23.6.0/bin/node
    npm: 10.8.1 - ~/.nvm/versions/node/v22.4.1/bin/npm
    pnpm: 10.3.0 - ~/.local/share/pnpm/pnpm
    bun: 1.2.3 - ~/.bun/bin/bun
  Managers:
    Apt: 2.4.11 - /usr/bin/apt
    Cargo: 1.80.1 - ~/.cargo/bin/cargo
    pip3: 22.0.2 - /usr/bin/pip3
  Utilities:
    CMake: 3.22.1 - /usr/bin/cmake
    Make: 4.3 - /usr/bin/make
    GCC: 11.4.0 - /usr/bin/gcc
    Git: 2.34.1 - /usr/bin/git
    Clang: 14.0.0 - /usr/bin/clang
    Curl: 7.81.0 - /usr/bin/curl
    OpenSSL: 3.0.2 - /usr/bin/openssl
  Virtualization:
    VirtualBox: 7.1.4 - /usr/bin/vboxmanage
  IDEs:
    Nano: 6.2 - /usr/bin/nano
    VSCode: 1.96.2 - /usr/bin/code
  Languages:
    Bash: 5.1.16 - /usr/bin/bash
    Java: 1.8.0_432 - /usr/bin/javac
    Perl: 5.34.0 - /usr/bin/perl
    Python3: 3.10.12 - /usr/bin/python3
    Rust: 1.80.1 - /home/hussein/.cargo/bin/rustc

Used Package Manager

bun

Logs

No response

Validations

@vitejs vitejs locked and limited conversation to collaborators Feb 15, 2025
@hi-ogawa hi-ogawa converted this issue into discussion #19432 Feb 15, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

1 participant