Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

247
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda