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

206
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
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