Closed nimit2801 closed 1 year ago
@nimit2801 thanks for raising this issue!
After googling a bit it seems like this might be a newer typescript config and we can get it to work if we update a few things in the sdk.
Some additional reference:
My tsconfig.json
file has "moduleResolution": "bundler"
and if I set it to "moduleResolution": "node"
it works for me!
We should be able to fix the problem If we update the exports in our package.json to:
"exports": {
".": {
"import": "./dist/esm/sdk.js",
"require": "./dist/cjs/sdk.js",
"types": "./types/index.d.ts"
},
"./package.json": "./package.json"
},
Thought for food https://github.com/gxmari007/vite-plugin-eslint/pull/60 this solves
We should be able to fix the problem If we update the exports in our package.json to:
"exports": { ".": { "import": "./dist/esm/sdk.js", "require": "./dist/cjs/sdk.js", "types": "./types/index.d.ts" }, "./package.json": "./package.json" },
Yup, exactly. Can I make a PR?
Possible solution which worked for me
My
tsconfig.json
file has"moduleResolution": "bundler"
and if I set it to"moduleResolution": "node"
it works for me!
this is not working when I am trying to build the project. I am using Vitejs and react
Possible solution which worked for me
My
tsconfig.json
file has"moduleResolution": "bundler"
and if I set it to"moduleResolution": "node"
it works for me!this is not working when I am trying to build the project. I am using Vitejs and react
Did you make the necessary changes? I suggested in the above solution.
Possible solution which worked for me
My
tsconfig.json
file has"moduleResolution": "bundler"
and if I set it to"moduleResolution": "node"
it works for me!
still seeing this in a fresh vite react project - should this issue still be open?
is "moduleResolution": "node"
the "right" solution? or a workaround? without knowing the total scope of that change, im wondering if it would be appropriate for all apps or if that might cause conflicts in some, but seems like it may be a package issue?
@colbyfayock
still seeing this in a fresh vite react project - should this issue still be open?
The fix will be in the next release of the SDK.
is "moduleResolution": "node" the "right" solution? or a workaround?
Both? The problem was the newer TS config is incompatible with our SDK.
๐ Reproduction steps
Step 1: Initialize a
Vite
ProjectRoot Cause Because
"moduleResolution"
is set to"bundler"
in mytsconfig.json
Step 2: Install appwrite
Step 3: Import App
๐ Expected behavior
It should not throw an error!
๐ Actual Behavior
It throws an error
๐ฒ Appwrite version
Version 0.10.x
๐ป Operating system
Linux
๐งฑ Your Environment
Nope!
๐ Have you spent some time to check if this issue has been raised before?
๐ข Have you read the Code of Conduct?