zotero-plugin-toolkit icon indicating copy to clipboard operation
zotero-plugin-toolkit copied to clipboard

Possible Compatibility Issue with React

Open raymondwjang opened this issue 1 year ago • 2 comments

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 ([email protected]), 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.

raymondwjang avatar Oct 24 '24 00:10 raymondwjang

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

windingwind avatar Oct 25 '24 16:10 windingwind

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.

windingwind avatar Oct 25 '24 16:10 windingwind