close
Skip to content

Bun's frontend development server - Source map incorrectly served when in production #28001

@jakeg

Description

@jakeg

What version of Bun is running?

1.3.10+30e609e08

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What steps can reproduce the bug?

This in server.js:

import homepage from './index.html'
Bun.serve({
  routes: { '/': homepage },
  development: false
})

This in index.html:

<!doctype html>
<title>Source map test</title>
<script type="module" src="script.js"></script>

This in script.js:

blah()

function blah () {
  let something = 'yes'
  console.log(something)
}

Run server.js and navigate to http://localhost:3000. Note that there's a source map even though there shouldn't be.

What is the expected behavior?

From https://bun.com/docs/bundler/fullstack#fullstack-dev-server:

Image

... clearly shows source maps should be disabled in production mode.

What do you see instead?

t();function t(){console.log("yes")}

//# debugId=33AA3B2AAFFF2EF964756E2164756E21
//# sourceMappingURL=/chunk-28r7bjn6.js.map
Image

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions