Fix React error #130 and backend event creation
Frontend fixes: - Disable verbatimModuleSyntax in TypeScript config to fix module imports - Add displayName to critical React components for better production debugging - Configure Vite build with manual chunks for better code splitting - Enable sourcemaps for production debugging Backend fixes: - Remove updated_at field from events table insert (column doesn't exist) - Fix SQL error that was causing 500 errors on event creation These changes resolve: - React error #130 that occurred during login and event creation - 500 Internal Server Error when creating new events - Better error tracking in production builds 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
This commit is contained in:
@@ -78,8 +78,7 @@ router.post('/', adminAuth, [
|
|||||||
color_theme,
|
color_theme,
|
||||||
share_link: shareLink,
|
share_link: shareLink,
|
||||||
expires_at,
|
expires_at,
|
||||||
created_at: new Date(),
|
created_at: new Date()
|
||||||
updated_at: new Date()
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Log activity
|
// Log activity
|
||||||
|
|||||||
@@ -49,4 +49,6 @@ export const AdminLayout: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
AdminLayout.displayName = 'AdminLayout';
|
||||||
@@ -311,4 +311,6 @@ export const AdminDashboard: React.FC = () => {
|
|||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
AdminDashboard.displayName = 'AdminDashboard';
|
||||||
@@ -210,4 +210,6 @@ export const AdminLoginPage: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
AdminLoginPage.displayName = 'AdminLoginPage';
|
||||||
@@ -438,4 +438,6 @@ export const CreateEventPage: React.FC = () => {
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
CreateEventPage.displayName = 'CreateEventPage';
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
/* Bundler mode */
|
/* Bundler mode */
|
||||||
"moduleResolution": "bundler",
|
"moduleResolution": "bundler",
|
||||||
"allowImportingTsExtensions": true,
|
"allowImportingTsExtensions": true,
|
||||||
"verbatimModuleSyntax": true,
|
"verbatimModuleSyntax": false,
|
||||||
"moduleDetection": "force",
|
"moduleDetection": "force",
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
"jsx": "react-jsx",
|
"jsx": "react-jsx",
|
||||||
|
|||||||
@@ -4,6 +4,17 @@ import react from '@vitejs/plugin-react'
|
|||||||
// https://vite.dev/config/
|
// https://vite.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
|
build: {
|
||||||
|
rollupOptions: {
|
||||||
|
output: {
|
||||||
|
manualChunks: {
|
||||||
|
'react-vendor': ['react', 'react-dom', 'react-router-dom'],
|
||||||
|
'ui-vendor': ['lucide-react', 'react-toastify'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
sourcemap: true,
|
||||||
|
},
|
||||||
server: {
|
server: {
|
||||||
port: 5173,
|
port: 5173,
|
||||||
host: true,
|
host: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user