Skip to content

Update index.cjs.js#6

Open
arjungole wants to merge 2 commits intoso-ric:masterfrom
arjungole:patch-1
Open

Update index.cjs.js#6
arjungole wants to merge 2 commits intoso-ric:masterfrom
arjungole:patch-1

Conversation

@arjungole
Copy link

Updated this to work it in lower versions of node js 16

Updated this to work it in lower versions of node js 16
Copy link
Author

@arjungole arjungole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review

@lucasgdb
Copy link

lucasgdb commented Oct 3, 2025

facing same issue here

@arjungole
Copy link
Author

facing same issue here

you can follow this for temporary solution:
If you are running on node verion14 or below and see below error in your pod logs, follow the below steps :

/opt/dist/node_modules/@so-ric/colorspace/dist/index.cjs.js:1976
(limiters[m] ||= [])[channel] = modifier;
^^^
SyntaxError: Unexpected token '||='
Steps:
Ensure patch-package Is Installed

npm install patch-package postinstall-postinstall --save-dev
2. In your package.json Add

"scripts": {
"postinstall": "patch-package"
}

  1. Modify the Problematic File

node_modules/@so-ric/colorspace/dist/index.cjs.js
Locate the line:

(limiters[m] ||= [])[channel] = modifier;
Replace it with:

limiters[m] = limiters[m] || [];
limiters[m][channel] = modifier;
Locate the line :

if (Object.hasOwn(cssKeywords, name)) {

Replace with:

if (Object.prototype.hasOwnProperty.call(cssKeywords, name)) {
Locate the line:

if (!Object.hasOwn(cssKeywords, match[1])) {
Replace with :

if (!Object.prototype.hasOwnProperty.call(cssKeywords, match[1])) {
4. Create the Patch
Run:

npx patch-package @so-ric/colorspace
And at last commit the patches folder

@alekstrust
Copy link

If I’m not wrong, you’re modifying the build output, so it’s not a reliable solution.

I managed to solve this issue by restoring a previous version of my package-lock.json (it's important to keep it in your repo), so npm resolves to an older version of the package.

This will probably work for me until I can move to Node 22.

@subramanya4shenoy
Copy link

Any idea if the repo owner is looking into it? moving back to the older version will that even help ? looks like the parent library should remove ^ from this package and keep a stable version

@Saddingt0n
Copy link

@alekstrust Would you happen to know what the solution is for a fresh project without an existing package-lock.json?

@alekstrust
Copy link

Well for a fresh project you should start with the latest version of node and you won't have any issues.

If you can't do that, what library are you using that's including this package? npm ls @so-ric/colorspace will help. Maybe I can send you the correct version from my package-lock or you can replace it manually in it with the original package (this colorspace package is a fork)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants