Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

541
Views
DefaultTheme en Material-UI provoca el error 'Nombre de módulo no válido en aumento'

Como se describe en los documentos de migración (v4 a v5), agregué esto a mi tema:

 import { createTheme, Theme } from '@mui/material/styles' import { grey } from '@mui/material/colors' declare module '@mui/styles/defaultTheme' { // <-- ts error // eslint-disable-next-line @typescript-eslint/no-empty-interface interface DefaultTheme extends Theme {} } const { palette } = createTheme() const { augmentColor } = palette // Create a theme instance. export const theme: Theme = createTheme({ palette: { neutral: augmentColor({ color: { main: grey[400] } }), } })

Pero me sale el error ts Invalid module name in augmentation, module '@mui/styles/defaultTheme' cannot be found.ts(2664)

¿Qué estoy haciendo mal?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

No sé por qué, pero importar el módulo para efectos secundarios lo soluciona:

 import { Theme } from "@mui/material/styles"; import "@mui/styles"; declare module "@mui/styles/defaultTheme" { // eslint-disable-next-line @typescript-eslint/no-empty-interface (remove this line if you don't have the rule enabled) interface DefaultTheme extends Theme {} }
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!