-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
fix(table-core): Avoid process not defined in environments not setting a process variable #5373
base: main
Are you sure you want to change the base?
Conversation
What environments do that? |
I have a situation where we are bundling Tanstack into a library component, then distributing the component as a standalone package that can be loaded directly in an html page. In this scenario, there is no process variable defined and the tanstack library fails. |
Are you sure that you're not accidentally importing from Also, maybe try importing from the |
I'm importing the Tanstack library into my project's component like this:
There wouldn't be a way to just import the pieces I need using the umd, would there? I'm also curious what the harm would be in detecting the process variable in the library before calling it? |
I have just never seen any other NPM library ever have to do this, so I think there should be a better way. |
When running the library in an environment that is not setting the process variable, the library throws a not defined error and breaks the render. This change checks to see if the variable exists before attempting to read it to avoid this.