question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find module '@saas-ui/forms/zod' or its corresponding type declarations

See original GitHub issue

After upgrading to version 1.0.1 from 1.0.0-rc.15, I’m no longer able to import zodFieldResolver, zodResolver from @saas-ui/forms/zod. This is how i was using it

// BaseForm.tsx
import { zodFieldResolver, zodResolver } from "@saas-ui/forms/zod";
import { Form as BaseForm } from "@saas-ui/react";
import { ZodTypeAny } from "zod";

BaseForm.getResolver = (schema: ZodTypeAny) => zodResolver(schema); // @hookform/resolvers
BaseForm.getFieldResolver = (schema: ZodTypeAny) => zodFieldResolver(schema); // AutoForm field resolver

export default BaseForm;

UPDATE: this issue always happens when I upgrade @saas-ui/react to the latest released version. Even if I revert back to the previous version after that, the problem still persists. So I delete node_modules and yarn.lock then I do a fresh installation of packages inside package.json

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:17 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
Pagebakerscommented, Jul 3, 2022

Fixed in 1.0.2

Thanks again!

0reactions
waptikcommented, Jul 10, 2022

I dont think so. Almost everything is re-exported from @saas-ui/react , as long as you import from there it shouldn’t cause any issues.

I see, I thought it did. It’s a good thing that the majority of components can be directly accessed through @saas-ui/react

Only for the form resolvers and auth services you need to import from /forms and /auth and thus add these to your package.json

I think it’d be great to put a notice somewhere in the docs about this issue(installing in monorepo vs non-monorepo) so that you don’t get other users asking the same question over again.

It might make sense though to create separate packages for the resolvers and auth services as it can cause problems like in your other issue when package versions are not in sync.

Yeah you’re right. It was a pain with another issue and fortunately, I managed to fix it.

Thanks for everything.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot find module 'react' or its corresponding type ...
The editor throws errors while importing every installed library like this: Cannot find module 'react' or its corresponding type declarations. The project ...
Read more >
Cannot find module '...' or its corresponding type declarations.
In v 3.x that your package json refers to there's no "root" jose export. And there's no exported member "JWK". Read the individual...
Read more >
Cannot find module 'X' Error in TypeScript | bobbyhadz
The "Cannot find module or its corresponding type declarations" error occurs when TypeScript cannot locate a third-party or local module in our project....
Read more >
cannot find module or its corresponding type declarations
The "Cannot find module or its corresponding type declarations" error occurs when TypeScript cannot locate a third-party or local module in our project....
Read more >
cannot find module '...' or its corresponding type declarations
I've been trying to deploy my nextjs app on Vercel, but got "Type error: cannot find module '...' or its corresponding type declarations" ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found