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

209
Visualizações
Vite and PostCSS issue, Invalid left-hand side in assignment

Everything was working fine, next day I'm getting an error Invalid left-hand side in assignment, the Chrome console tap was showing the error Invalid left-hand side in assignment a file with a name ${mod.url});` which is points to the source file and the code is:

var createContext = (ctx) => {
  ctx = Object.assign({
    cwd: process.cwd(),
    env: "development"
  }, ctx);
  if (!ctx.env) {
    "development" = "development"; // <-- pointing to this line
  }
  return ctx;
};

after checking I found that file is node_module/postcss-load-config/index.js, and code part:

    /**
 * Builds the Config Context
 *
 * @param  {Object} ctx Config Context
 *
 * @return {Object} Config Context
 */
const createContext = (ctx) => {
  /**
   * @type {Object}
   *
   * @prop {String} cwd=process.cwd() Config search start location
   * @prop {String} env=process.env.NODE_ENV Config Enviroment, will be set to `development` by `postcss-load-config` if `process.env.NODE_ENV` is `undefined`
   */
  ctx = Object.assign({
    cwd: process.cwd(),
    env: process.env.NODE_ENV
  }, ctx)

  if (!ctx.env) {
    process.env.NODE_ENV = 'development' // <-- HERE!
  }

  return ctx
}

I delete the directory node_module, delete the docker container and image, I did update the package.json dependencies and devDependencies, all of this did not solve the issue. Also, I remove the postcss, the result is the same. The site is developed with Vite, Vue and Tailwindcss latest version

For me this is a big challenge, so would someone kindly help me out of this?

Thanks,

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

I remove code, then it works

import { createLogger } from 'vite'
export createLogger

change this to

export const logger = console.log.bind(console)

I found that I used some node utils in broswer.

about 4 years ago · Juan Pablo Isaza Relatório

0

It seems that this happens when your code editor automatically adds import statements when you did not want it to. The same thing happened to me. I guess it could happen if you added an import statement on accident by yourself. I removed the erroneous import statement and now the error is gone.

about 4 years ago · Juan Pablo Isaza Relatório
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