Yesterday everything was running smoothly, but today I encountered an error message saying
Invalid left-hand side in assignment
. When I checked the Chrome console, it displayed the same error related to a file named ${mod.url}
pointing to this source code:
var createContext = (ctx) => {
ctx = Object.assign({
cwd: process.cwd(),
env: "development"
}, ctx);
if (!ctx.env) {
"development" = "development"; // <-- pointing to this line
}
return ctx;
};
Upon investigation, I discovered that the problematic file is
node_module/postcss-load-config/index.js
, and the relevant code snippet is as follows:
const createContext = (ctx) => {
ctx = Object.assign({
cwd: process.cwd(),
env: process.env.NODE_ENV
}, ctx)
if (!ctx.env) {
process.env.NODE_ENV = 'development' // <-- HERE!
}
return ctx
}
I have tried deleting the node_module
directory, removing docker containers and images, updating dependencies in
package.json</code, and even removing <code>postcss
without success. The website uses the latest versions of Vite, Vue, and Tailwindcss.
This issue has become quite challenging for me, so any assistance would be greatly appreciated.
Thank you,