We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
1.0.29
Darwin 21.6.0 arm64 arm
A lazy import in code like below (layout/home) is not resolved correctly in the output bundle -
import * as ReactDOM from "react-dom/client"; import { lazy } from "react"; import { createBrowserRouter, RouterProvider } from "react-router-dom"; const Home = lazy(() => import("./layouts/home")); const router = createBrowserRouter([ { path: "/", element: <Home />, errorElement: <ErrorPage />, } ]); const rootDiv = document.getElementById("root") as HTMLElement; const root = ReactDOM.createRoot(rootDiv); root.render(<RouterProvider router={router} />);
Build javascript code -
Bun.build({ entrypoints: [import.meta.dir + "/src/index.tsx"], outdir: BUILD_PATH, minify: true, splitting: true, });
In the built output file (/index.js) -
// Expected V.lazy(() => import("./layouts/home/index.js")),
V.lazy(() => import("./layouts/home/index.js")),
// Seen V.lazy(() => import("layouts/home/index.js")),
V.lazy(() => import("layouts/home/index.js")),
Is there any solution to fix this issue?
The text was updated successfully, but these errors were encountered:
@Electroid @Jarred-Sumner any idea what are we missing for above expected behavior?
Sorry, something went wrong.
quick fix Bun.build({ publicPath: "./" });
Thanks @shpaw415 worked!
if you look for thanking me. could you please put a star on my repo.. https://github.com/shpaw415/bunext
@shpaw415 You can also check my recent work on React CSR. I appreciate your feedback. Thanks. https://github.com/hedaukartik/bun-react-csr-base
No branches or pull requests
What version of Bun is running?
1.0.29
What platform is your computer?
Darwin 21.6.0 arm64 arm
What steps can reproduce the bug?
A lazy import in code like below (layout/home) is not resolved correctly in the output bundle -
Build javascript code -
What is the expected behavior?
In the built output file (/index.js) -
// Expected
V.lazy(() => import("./layouts/home/index.js")),
What do you see instead?
// Seen
V.lazy(() => import("layouts/home/index.js")),
Additional information
Is there any solution to fix this issue?
The text was updated successfully, but these errors were encountered: