Closed girishvisaero closed 4 weeks ago
Hello @girishvisaero. Please provide a reproduction repository or online demo. For background, see Why reproductions are required. Thanks ❤️
I changed the configuration to normal configuration and it works, is there any change that I am doing?
current rsbuild.config.js
import { defineConfig, loadEnv } from '@rsbuild/core';
import { pluginReact } from '@rsbuild/plugin-react';
import { pluginSvgr } from '@rsbuild/plugin-svgr';
const { publicVars } = loadEnv({ prefixes: ['REACT_APP_'] });
export default defineConfig({
plugins: [pluginReact(), pluginSvgr({ mixedImport: true })],
html: {
template: './public/index.html',
},
output: {
distPath: {
root: 'build',
},
},
source: {
define: publicVars,
},
server: {
open: 'http://localhost:<port>/',
},
dev: {
hmr: true,
client: {
host: 'localhost',
protocol: 'ws',
overlay: true,
},
},
tools: {
rspack: {
module: {
rules: [
{
// Match .png asset
// You can change this regular expression to match different types of files
test: /\.png$/,
type: 'asset/resource',
generator: {
filename: 'static/media/[name].[hash][ext]',
},
},
],
},
},
},
});
which is working now but for old it is not,
@chenjiahan I think it’s config issue, I replaced the rsbuild config and it’s working now and I m closing this issue.
Get 👌
but you need use this code block moduleFederation: { options: { name: 'remote', exposes: { // './app': './src/expose', './Dashboard': './src/Components/Dashboard/Dashboard', }, filename: 'remoteEntry.js', // other options }, }, if you want use moduleFederation ? @girishvisaero @chenjiahan
Tes
Version
Details
// using rsbuild.config.js
Reproduce link
N/A ==> organization project
Reproduce Steps
Steps to Reproduce:
Set up a React project using rsbuild. Create nested routes within your React Router configuration, such as: /dashboard (renders correctly) Add a button within the /dashboard route that redirects to /dashboard/newsite. Click the "New Site" button to navigate to /dashboard/newsite. (This works as expected) Refresh the page while on /dashboard/newsite. (The page fails to render correctly after refreshing) Run the project using rsbuild. Attempt to navigate directly to /dashboard/newsite in the browser or refresh the page after navigating to this URL.