typing issues with index.ts #1598
-
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
Hi @hyusetiawan! With the caret selector Would you please share your installed version of |
Beta Was this translation helpful? Give feedback.
-
But If i change to node, it would break my frontend ui application import
no?
…On Fri, Aug 25, 2023 at 6:26 PM Vicary A. ***@***.***> wrote:
The bundler option requires dependent packages to host a different set of
type definition files. i.e. It was .d.ts for both .js and .mjs, we now
need a new set of .d.mts and a modified package.json for that to work.
It is within my plans, but it may not happen immediately. You may fallback
to "moduleResolution": "node" for the moment, and use a separate tsconfig
via extend directive for builds.
—
Reply to this email directly, view it on GitHub
<#1598 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIDQCHWYQKURBILI6WBKRTXXFGE3ANCNFSM6AAAAAA37FPWKU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
To anyone else still having problems with this. I have a fix.In my case, I mostly used the default values when running the CLI. ProblemThe problem was I was generating the files on the default directory on the CLI:
CauseI can't believe I didn't catch it right away but it was caused by "gqty // gqty/index.ts
// this is confused between 'node_modules/gqty' and 'gqty/index.ts' ⬇️
import { Cache, GQtyError, createClient, type QueryFetcher } from 'gqty'; SolutionJust change the generated client location when running the CLI:
AdditionallyFor ease of use it depends on you if you want to do this too, but it helps so you can access the client easily. // tsconfig.json
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"], // you can import with: `from '@/gqty'`
"~gqty": ["./src/gqty/index.ts"] // you can import with: `from '~gqty'
}
} |
Beta Was this translation helpful? Give feedback.
Using
"moduleResolution": "node"
works in our Next 13 and Vite examples. If you do see it breaking, please share more info about your particular setup.