parcel-bundler / parcel

The zero configuration build tool for the web. 📦🚀
https://parceljs.org
MIT License
43.38k stars 2.26k forks source link

[bug] empty Namespace overwrite Identifier with same name #7739

Open TechQuery opened 2 years ago

TechQuery commented 2 years ago

🎛 Configuration

tsconfig.json

{
  "compilerOptions": {
    "moduleResolution": "Node",
    "jsx": "react",
    "jsxFactory": "createCell",
    "jsxFragmentFactory": "Fragment",
    "lib": ["ES2021", "DOM"]
  }
}

🤔 Expected Behavior

Compile

export function jsx(
  tag: string | FunctionComponent,
  data: VNodeData | null,
  ...children: JsxVNodeChildren[]
): VNode {
  // ...
}

export namespace jsx {
  export import JSX = JSXInternal; // eslint-disable-line @typescript-eslint/no-unused-vars
}

to correct codes:

function jsx(tag, data, ...children) {
  // ...
}
-jsx = {
-};

😯 Current Behavior

When my project started, an error thrown:

Uncaught (in promise) TypeError: _snabbdom.jsx is not a function

but Test scripts in ts-jest works well...

🔦 Context

  1. SnabbDOM source code
  2. WebCell version depended on SnabbDOM version above

🌍 Your Environment

Software Version(s)
Parcel 2.3.2
Node 14.17.6
NPM 6.14.16
Yarn 1.22.15
Operating System Windows 10 Pro 21H1
TechQuery commented 2 years ago

@mischnic Could you try to debug this error?

TechQuery commented 1 year ago

I'll check this bug during new version development: EasyWebApp/WebCell#15

TechQuery commented 6 months ago

I'll check this bug during new version development: EasyWebApp/WebCell#15

This PR has been merged with no error, which replaced SnabbDOM with DOM Renderer for JSX.

So I have resolved my problem, but other SnabbDOM users may have the same bug.

github-actions[bot] commented 1 week ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.