Back

Typescript Error when importing `appwrite`: /appwrite/dist/esm/sdk.js' implicitly has an 'any' type.

  • 0
  • Web
nicko
11 Jun, 2023, 05:50

Hey guys! having a typescript issue in the web sdk (tried in both a new React and Vue project). This was also attached to the error:

There are types at '.../appwrite-project/node_modules/appwrite/types/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'appwrite' library may need to update its package.json or typings.ts(7016)"

so, i checked out the appwrite/package.json, it seems like this "exports" field is causing some issues with ts.

TypeScript
"exports": {
    ".": {
      "import": "./dist/esm/sdk.js",
      "require": "./dist/cjs/sdk.js"
    },
    "./package.json": "./package.json"
  },

Any help would be greatly appreciated!

TL;DR
User is experiencing a typescript error when importing 'appwrite' in a new React or Vue project. The error message suggests that the 'exports' field in appwrite's package.json is causing the issue. The user asks for guidance or a solution to the problem.
nicko
11 Jun, 2023, 05:53

should i submit a bug-report in the repo?

Drake
11 Jun, 2023, 06:17

No, try searching <#1072905050399191082> . This should have been answered already

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more