When trying to use it directly such as server side rendering, no errors but when trying to bundle it (to either target Bun or Browser) you get Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
bun run index.tsx and visit the server, no error.
Then bun build index.tsx --target=bun --outdir ./foo and run the output index.js and visit the server, you would see the error.
AN error indicating that perhaps mixing named and default imports.
Additional information
Others mentioned this issue in the React-Bootstrap library https://github.com/react-bootstrap/react-bootstrap/issues/6717 - so if that helps gives any more context linking it. Considering it works in Node/Parcel it was recommended to file the issue here instead.
What version of Bun is running?
1.0.18+36c316a24
What platform is your computer?
Darwin 23.2.0 arm64 arm
What steps can reproduce the bug?
When trying to use it directly such as server side rendering, no errors but when trying to bundle it (to either target Bun or Browser) you get
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
bun run index.tsx
and visit the server, no error.Then
bun build index.tsx --target=bun --outdir ./foo
and run the outputindex.js
and visit the server, you would see the error.I made a little minimum demo if it helps:
bun-react-bootstrap.zip
What is the expected behavior?
It would work as expected without an error.
What do you see instead?
AN error indicating that perhaps mixing named and default imports.
Additional information
Others mentioned this issue in the React-Bootstrap library https://github.com/react-bootstrap/react-bootstrap/issues/6717 - so if that helps gives any more context linking it. Considering it works in Node/Parcel it was recommended to file the issue here instead.