Skip to content
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

Bun html dev server ReferenceError: exports is not defined when using certain dependencies #17991

Open
RiskyMH opened this issue Mar 8, 2025 · 0 comments
Labels
bake:dev hot-reloading dev server for client+server applications bug Something isn't working confirmed bug We can reproduce this issue

Comments

@RiskyMH
Copy link
Member

RiskyMH commented Mar 8, 2025

What version of Bun is running?

1.2.5-canary.109+589fa6274

What platform is your computer?

windows

What steps can reproduce the bug?

  1. make index.js and index.html
  2. install @paralleldrive/cuid2
  3. run dev mode - bun index.html
  4. open browser
// index.js
import { createId } from "@paralleldrive/cuid2"; 
console.log(createId())
<!-- index.html -->
<script type="module" src="index.js"></script>

What is the expected behavior?

to log a random string in console

What do you see instead?

ReferenceError: exports is not defined
  at ../node_modules/ in paralleldrive/cuid2/src/index.js@http://localhost:3000/_bun/client/a-000000008c84d02b.js:93:5
  at ../node_modules/ in paralleldrive/cuid2/index.js@http://localhost:3000/_bun/client/a-000000008c84d02b.js:25:69
  at 

Additional information

Works in bun build of the html/js, and in normal runtime

@RiskyMH RiskyMH added bake:dev hot-reloading dev server for client+server applications bug Something isn't working confirmed bug We can reproduce this issue labels Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bake:dev hot-reloading dev server for client+server applications bug Something isn't working confirmed bug We can reproduce this issue
Projects
None yet
Development

No branches or pull requests

1 participant