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

Character is broken in jsx. Output #124

Closed
csr632 opened this issue May 21, 2020 · 1 comment
Closed

Character is broken in jsx. Output #124

csr632 opened this issue May 21, 2020 · 1 comment

Comments

@csr632
Copy link

csr632 commented May 21, 2020

reproduce:

(async () => {
  const jsx = `
import React from "react";

function App() {
  return <div className="App">

  </div>
}

export default App;
`

  // Start the esbuild child process once
  const esbuild = require('esbuild')
  const service = await esbuild.startService()

  // This can be called many times without the overhead of starting a service
  const { js } = await service.transform(jsx, { loader: 'jsx' })
  console.log(js)

  // The child process can be explicitly killed when it's no longer needed
  service.stop()
})()

output:

import React from "react";
function App() {
  return React.createElement("div", {
    className: "App"
  }, "�");
}
export default App;

esbuild version: 0.3.5

@evanw
Copy link
Owner

evanw commented May 21, 2020

I see why this happens. Thanks so much for reporting this. Will push a fix soon.

@evanw evanw closed this as completed in c949276 May 21, 2020
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

No branches or pull requests

2 participants