windingwind / zotero-plugin-toolkit

Toolkit for Zotero Plugin Developers.
https://www.npmjs.com/package/zotero-plugin-toolkit
MIT License
115 stars 13 forks source link

Possible Compatibility Issue with React #69

Open raymondwjang opened 4 weeks ago

raymondwjang commented 4 weeks ago

Hello,

I'd love to incorporate this package into my project, but I'm having trouble implementing it. I installed it with npm install zotero-plugin-toolkit, confirmed its version (zotero-plugin-toolkit@4.0.7), and imported it like below:

import { ZoteroToolkit } from "zotero-plugin-toolkit";

Now, when I try to build the package with the import statement, I'm met with a long list of type incompatibility error stack trace that involves both react and zotero-plugin-toolkit.

This issue disappears if the zotero-plugin-toolkit import statement is removed.

Would it be possible to get support on this?

My react version is 18.3.1.

windingwind commented 3 weeks ago

Hi, thanks for reporting this. Could you please provide a git repo or a GitHub workspace that can reproduce this?

windingwind commented 3 weeks ago

Errors like error TS2304: Cannot find name 'WeakRef'. might indicate that you are on a lower version of the TS server, or you have not configured it as expected. Could try:

  1. Upgrade the TS server
  2. Check the current TS server (workspace v.s. global, if you are using IDE like VSCode)
  3. Check the current tsconfig of the project, e.g. compilerOptions > lib.