Skip to content

Commit 242a3ed

Browse files
authored
fix: rsbuild issues (#3152)
1 parent 3e64426 commit 242a3ed

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

rsbuild.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ export default defineConfig({
8383
sourceMap: {
8484
js: process.env.GENERATE_SOURCEMAP !== 'false' ? 'source-map' : false,
8585
},
86+
// Inline CSS in development to prevent FOUC
87+
injectStyles: process.env.NODE_ENV === 'development',
8688
},
8789
html: {
8890
template: './public/index.html',

src/store/reducers/capabilities/capabilities.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ export const capabilitiesApi = api.injectEndpoints({
3030
} catch (error) {
3131
// If capabilities endpoint is not available, there will be an error
3232
// That means no new features are available
33-
return {error};
33+
// Serialize the error to make it Redux-compatible
34+
const serializedError =
35+
error instanceof Error ? {message: error.message, name: error.name} : error;
36+
return {error: serializedError};
3437
}
3538
},
3639
}),

0 commit comments

Comments
 (0)