oslllo / svg-fixer

Converts SVG Strokes To Fill.
https://docs.oslllo.com/svg-fixer/master/
MIT License
208 stars 16 forks source link

Issue with NODE_ENV #43

Closed giovanni-bertoncelli closed 3 years ago

giovanni-bertoncelli commented 3 years ago

First of all: great project! It is helping me a lot...

I was wondering why there is a check on the NODE_ENV environment variable inside the osllo/validator package. I have set that for my environment needs and I have to manually reset that when I want to use this package... Is that necessary to determine that it is not a node environment?

Ghustavh97 commented 3 years ago
/**
 * Try to detect if node or browser build in webpack
 */
if (typeof process.env.NODE_ENV === "undefined" && isNode && !isBrowser) {

Looks like I made the mistake of calling NODE_ENV directly without checking if the other keys or the process variable is set.

I did this to try and support both node and browser environments, but it seems like using the validator for this package is a bit over kill so I will push a fix to remove it and make svg-fixer use its own validation functions.

Ghustavh97 commented 3 years ago

@giovanni-bertoncelli could you please provide me with a way to reproduce the error so that I can confirm that I have fixed it?

giovanni-bertoncelli commented 3 years ago

Try running the node process with NODE_ENV=dev

Ghustavh97 commented 3 years ago

@giovanni-bertoncelli Thanks! Please try the latest version 1.2.1 to see if the issue has been fixed.