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

204
Views
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 answers
Answer question

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 Report

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