Skip to content
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

undefined reference to XYZUtils #1

Open
dominic-chang opened this issue Dec 22, 2024 · 0 comments
Open

undefined reference to XYZUtils #1

dominic-chang opened this issue Dec 22, 2024 · 0 comments

Comments

@dominic-chang
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch xyz-utils@0.5.2 for the project I'm working on.

I experienced a bug when importing this module that the XYZUtils is undefined. I think it's because it is exported without declaration, so I just added a declaration line before which seemed to fix it.

Here is the diff that solved my problem:

diff --git a/node_modules/xyz-utils/index.js b/node_modules/xyz-utils/index.js
index 6bd53e2..5c4b4fb 100644
--- a/node_modules/xyz-utils/index.js
+++ b/node_modules/xyz-utils/index.js
@@ -164,7 +164,7 @@ function fromLuv (vec, result) {
 	return result;
 }
 
-module.exports = XYZUtils = {
+var XYZUtils = {
 	toRGB: MatrixVectorMultiply.bind(null, XYZtoRGB),
 	fromRGB: MatrixVectorMultiply.bind(null, RGBtoXYZ),
 	toxyY: toxyY,
@@ -172,3 +172,4 @@ module.exports = XYZUtils = {
 	toLuv: toLuv,
 	fromLuv: fromLuv
 };
+module.exports = XYZUtils

This issue body was partially generated by patch-package.

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

No branches or pull requests

1 participant