paljs / prisma-tools

Prisma tools to help you generate CRUD system for GraphQL servers
https://paljs.com
MIT License
687 stars 55 forks source link

Resolving MUI theme import error #201

Closed divideby0 closed 3 years ago

divideby0 commented 3 years ago

When starting up the MUI-templated application with yarn dev, I received the following error:

TypeError: Cannot read property 'primary' of undefined at MyDocument.render (webpack-internal:///./src/pages/_document.tsx:35:73)

I believe this is due to an attempt to import the theme from _app.tsx without destructing the exported theme const

divideby0 commented 3 years ago

I verified that the app would load correctly after this change.

Also, just as a style note, I've found that our team often extend and reference custom MUI themes pretty often as we build out our app. It may eventually be worth extracting the theme out into its own theme.ts file to help people know where to look.

AhmedElywa commented 3 years ago

Hi @divideby0, Thanks for your PR but this issue is more than change the import you can find my fix here https://github.com/paljs/prisma-tools/commit/eede98c7872c73b2352184489bad4851092b550d

pushed new fix with last version