File tree Expand file tree Collapse file tree
examples/app-react-crud/src/mocks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ export async function startMockServer() {
1919
2020 console . log ( '[MSW] Starting ObjectStack Runtime (Browser Mode)...' ) ;
2121
22+ // Handle CommonJS/ESM interop for config loading
23+ const appConfig = ( todoConfig as any ) . default || todoConfig ;
24+
2225 const driver = new InMemoryDriver ( ) ;
2326
2427 // Create kernel with MiniKernel architecture
@@ -31,7 +34,7 @@ export async function startMockServer() {
3134 await kernel . use ( new DriverPlugin ( driver , 'memory' ) ) ;
3235
3336 // Load todo app config as a plugin
34- await kernel . use ( new AppPlugin ( todoConfig ) ) ;
37+ await kernel . use ( new AppPlugin ( appConfig ) ) ;
3538
3639 // MSW Plugin (intercepts network requests)
3740 await kernel . use ( new MSWPlugin ( {
@@ -132,7 +135,7 @@ export async function startMockServer() {
132135 }
133136
134137 // Initialize default data from manifest if available
135- const manifest = ( todoConfig as any ) . manifest ;
138+ const manifest = appConfig . manifest ;
136139 if ( manifest && Array . isArray ( manifest . data ) ) {
137140 console . log ( '[MSW] Loading initial data...' ) ;
138141 for ( const dataset of manifest . data ) {
You can’t perform that action at this time.
0 commit comments