SoftwareBrothers / adminjs-sequelizejs

Sequelizejs adapter for AdminBro
MIT License
27 stars 34 forks source link

Not working with sqlite #54

Closed EdByrnee closed 2 years ago

EdByrnee commented 3 years ago

When using sqlite for database API works fine, but loading the admin dashboard fails and the chrome console has the following errors:

design-system.bundle.js:223160 Uncaught TypeError: Cannot read property 'split' of undefined
    at NavigationElement (design-system.bundle.js:223160)
    at renderWithHooks (global.bundle.js:37614)
    at mountIndeterminateComponent (global.bundle.js:40293)
    at beginWork (global.bundle.js:41407)
    at HTMLUnknownElement.callCallback (global.bundle.js:22999)
    at Object.invokeGuardedCallbackDev (global.bundle.js:23048)
    at invokeGuardedCallback (global.bundle.js:23103)
    at beginWork$1 (global.bundle.js:46014)
    at performUnitOfWork (global.bundle.js:44968)
    at workLoopSync (global.bundle.js:44941)
global.bundle.js:42338 The above error occurred in the <NavigationElement> component:
    in NavigationElement (created by NavigationElementWrapper)
    in li (created by NavigationElementWrapper)
    in NavigationElementWrapper (created by Navigation)
    in ul (created by Navigation)
    in section (created by Styled(styled.section))
    in Styled(styled.section) (created by Navigation)
    in Navigation (created by SidebarResourceSectionOriginal)
    in SidebarResourceSectionOriginal (created by WrapperComponent)
    in WrapperComponent (created by Sidebar)
    in section (created by styled.section)
    in styled.section (created by Sidebar)
    in section (created by sidebar__StyledSidebar)
    in sidebar__StyledSidebar (created by Sidebar)
    in Sidebar (created by App)
    in section (created by styled.section)
    in styled.section (created by App)
    in App
    in Router (created by BrowserRouter)
    in BrowserRouter
    in Unknown
    in Provider

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://fb.me/react-error-boundaries to learn more about error boundaries.
logCapturedError @ global.bundle.js:42338
global.bundle.js:45476 Uncaught TypeError: Cannot read property 'split' of undefined
    at NavigationElement (design-system.bundle.js:223160)
    at renderWithHooks (global.bundle.js:37614)
    at mountIndeterminateComponent (global.bundle.js:40293)
    at beginWork (global.bundle.js:41407)
    at HTMLUnknownElement.callCallback (global.bundle.js:22999)
    at Object.invokeGuardedCallbackDev (global.bundle.js:23048)
    at invokeGuardedCallback (global.bundle.js:23103)
    at beginWork$1 (global.bundle.js:46014)
    at performUnitOfWork (global.bundle.js:44968)
    at workLoopSync (global.bundle.js:44941)
DevTools failed to load SourceMap: Could not load content for chrome-extension://onimolfnbjjikjiialpfahffkjjgdgkh/content-detached.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
DevTools failed to load SourceMap: Could not load content for chrome-extension://onimolfnbjjikjiialpfahffkjjgdgkh/content-detached.css.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME

Dashboard works fine with mysql, surely admin bro is agnostic to this all abstraction handled by sequelize?

dziraf commented 3 years ago

This is an issue with SQLite resources not being linked to any navigation parent automatically, you can fix this in your project by defining navigation property in your resource options, i. e.:

user.resource.js

module.exports = { resource: User, options: { navigation: { name: null, icon: 'Person' } } }

I'll leave the issue open because this is actually a bug which should be fixed in the future.