Skip to content

Conversation

@rcastellotti
Copy link
Contributor

@rcastellotti rcastellotti commented Oct 29, 2025

Hi!
I noticed that running this script with bun create preact fails.

rc@den~> bun create preact
┌  Preact - Fast 3kB alternative to React with the same modern API
│
◇  Project directory:
│  test
│
◇  Project language:
│  JavaScript
│
◇  Use router?
│  No
│
◇  Prerender app (SSG)?
│  No
│
◇  Use ESLint?
│  No
│
◇  Set up project directory
│
▲  Something went wrong

This PR aims to fix it. ❤️ 🐻 🏴‍☠️

const userAgent = process.env.npm_config_user_agent || '';
if (userAgent.startsWith('yarn')) return 'yarn';
if (userAgent.startsWith('pnpm')) return 'pnpm';
if (!!process.versions.bun) return 'bun';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rschristian
Copy link
Member

Hopefully you've tested this? The installation will go through without any issue once this is added?

Not a bun user so I have no easy way of checking.

@rcastellotti
Copy link
Contributor Author

Sorry, I thought I added it :)

rc@den ~/create-preact (bun-deps)> bun run src/index.js
┌  Preact - Fast 3kB alternative to React with the same modern API
│
◇  Project directory:
│  testbun
│
◇  Project language:
│  JavaScript
│
◇  Use router?
│  No
│
◇  Prerender app (SSG)?
│  No
│
◇  Use ESLint?
│  No
│
◇  Set up project directory
│
◇  Installed project dependencies
│
◇  Getting Started ─╮
│                   │
│  $ cd testbun     │
│  $ bun dev        │
│                   │
├───────────────────╯
│
└  You're all set!

Copy link
Member

@rschristian rschristian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Just wanted to double check, yarn was a bit fiddly with its install script so it's worth giving these things a test before publishing is all.

Will hopefully publish this later.

@rschristian rschristian merged commit 9ae3c50 into preactjs:master Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants