Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can typia work with nuxt3? #775

Closed
huyoo opened this issue Aug 22, 2023 · 2 comments
Closed

Can typia work with nuxt3? #775

huyoo opened this issue Aug 22, 2023 · 2 comments

Comments

@huyoo
Copy link

huyoo commented Aug 22, 2023

Question

Hello!
I'm trying to use typia paired with nuxt3 for JSON validation, but I'm keep getting an error:

no transform has been configured. Read and follow https://typia.io/docs/setup please.

I run the project with pnpm run dev
code like this

interface Query {
  projectId: string
  pId?: string
}

function queryFn(params) {
  typia.validate<Query >(params)
}

queryFn({
  projectId: 'testId'
})

Is there any way to run typia with nuxt3?

P.S. “pnpm typia setup --manager pnpm” didn't help =)

@jmroon
Copy link

jmroon commented Aug 22, 2023

Did you add the typescript plugin to vite as detailed on the page you linked?

And does your tsconfig have a transform section? The typia setup should have added it. It should look something like this:

image

@ryoppippi
Copy link
Contributor

Hi guys!
I made a plugin for bundlers
Check this out and plz give us a feedback!

https://typia.io/docs/setup/#unplugin-typia

Note that this plugin supports ts/tsx files only, so if you wan to use Typia for your nuxt project, define validation functions in .ts and then import them in .vue file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants