TanStack / TanStack/table

`process is not defined` when used in Vanilla JS (without Node.js)

Open
#6,078 2 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
28.4k
Forks
3.6k
Avg merge
1d 14h
Merged PRs (30d)
10

Description

TanStack Table version

v8.21.3

Framework/Library version

vanilla (through Rails importmap)

Describe the bug and the steps to reproduce it

I'm using @tan-stack/table-core in vanilla JS without any bundler or Node.js runtime. It seems that createTable() function checks runtime environment for debugging, which throw an exception for my setup.

const M = [t, c, s, a, n, l, p, m, F, r, f, C, h, S, g];
function createTable(e) {
    var t, n;
    process.env.NODE_ENV !== "production" && (e.debugAll || e.debugTable) && console.info("Creating Table Instance...");

I temporarily use a mock process object to workaround. Would it be nicer to check process at first?

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

(no need)

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

Yes, I think I know how to fix it and will discuss it in the comments of this issue

Terms & Code of Conduct
  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the createTable() entry point and inspect the generated code path containing the process.env.NODE_ENV check. Reproduce the issue by importing @tan-stack/table-core through a Rails importmap in vanilla JavaScript without Node.js, and consider the work done when table creation no longer raises “process is not defined” in that environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.