Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

250
Vistas
MUI's codemod for converting jss components to styled not working

I am migrating from MUI v4 to v5.

So I have countless components that needs to be changed from the makeStyles API to the styled or sx.

As per their migration docs, MUI has a codemod script that may automate a lot of that work.

In order to run this script, I installed as a dev dependency:

npm install -D @mui/codemod

and ran the script as the docs said to:

npx @mui/codemod v5.0.0/jss-to-styled /path/to/my/file/test.tsx

Unfortunately, this is not working, and I am always getting the following error:

TypeError: $ is not a function
    at Object.<anonymous> (/mypath/node_modules/core-js/modules/es.regexp.exec.js:7:1)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Module._compile (/mypath/node_modules/pirates/lib/index.js:136:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Object.newLoader [as .js] (/mypath/node_modules/pirates/lib/index.js:141:7)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:93:18)
    at Object.<anonymous> (/mypath/node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js

I even made a test file with just JS to see if it would work, and still nothing.

This is what my test file looks like as an example:

import React from 'react'
import Typography from '@mui/material/Typography'
import makeStyles from '@mui/styles/makeStyles'

const useStyles = makeStyles(() => ({
  typographyRoot: {
    color: 'red',
    backgroundColor: 'blue',
  },
}))

const Test = () => {
  const classes = useStyles()
  return (
    <Typography classes={{ root: classes.typographyRoot }}>
      Bla bla bla
    </Typography>
  )
}

export default Test

Does anyone know if I am doing something wrong and how to get this to work?

Thanks!

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda