-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReferenceError: Invalid left-hand side in assignment when using 'Kubernetes-client' model #500
Comments
@darlenya , I am running to the same issue on a project that I am working on. Did you figure out how to fix this problem? |
I am having similar issue with puppeteer-extra and their stealth plugin Here is the code:
|
After a bit of investigation, the issue comes from a In case of
I'm yet to find out what would be the way to affect ncc builds to fix the actual code generated. |
For anyone stumbling upon this: const path = require('path');
const fs = require('fs');
const nowNode = require('@vercel/node');
const buildUtils = require('@vercel/build-utils');
(async () => {
process.env.NOW_BUILDER_DEBUG = true;
const projectPath = path.resolve(process.env.LAMBDA_DIR);
const entrypoint = process.env.ENTRYPOINT;
const workPath = await buildUtils.getWriteableDirectory();
const inputFiles = await buildUtils.glob('**', projectPath);
const result = await nowNode.build({
files: inputFiles,
workPath,
entrypoint,
meta: {
awsLambdaHandler: entrypoint
}
});
console.log("Storing the archive...");
fs.writeFileSync(path.resolve(projectPath, 'code.zip'), result.output.zipBuffer);
})(); Where It worked because |
Yes, the project I am currently working on it's essential for me to compile everything into one file. |
The version of "resolutions": {
"clone-deep": "4.0.1"
} |
if (global.GENTLY) nccwpck_require(94120) = GENTLY.hijack(require); |
if (global.GENTLY) nccwpck_require(94120) = GENTLY.hijack(require); SyntaxError: Invalid left hand side for assignment |
Is there any update on this? |
@Chheung , It's tough for NCC to support all these early node js ways to do autoloading. I do not think it's going to happen. I spent quite a bit of time making it work for a project I was working on, and the issues are the autoloading from old/very popular packages. If you must use NCC, my recommendation is to figure out which packages it's having issues with and try to implement them yourself, but it's a nightmare/rabbit hole. |
Hello Team,
I added the module 'Kubernetes-client' to my project. Since then I got the error when using ncc:
ReferenceError: Invalid left-hand side in assignment at Object.<anonymous> (demo-ncc-error/dist/index.js:203847:1) at __webpack_require__ (demo-ncc-error/dist/index.js:22:30)
The error was caused by
`
...
var utils = webpack_require(201)(require);
var fn = require;
webpack_require(905) = utils; // The line which caused the error
webpack_require(905)('is-plain-object', 'isObject');
webpack_require(905)('shallow-clone', 'clone');
webpack_require(905)('kind-of', 'typeOf');
webpack_require(973);
webpack_require(905) = fn;
...
`
Here is an example project showing the issue.
To reproduce the issue execute:
npm install
npm run build
node dist/index.js
demo-ncc-error.zip
With kind regards
Torsten
The text was updated successfully, but these errors were encountered: