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

Could not find a declaration file for module 'nextra'. implicitly has an 'any' type #2948

Open
sarkaramitabh300 opened this issue Jun 26, 2024 · 2 comments

Comments

@sarkaramitabh300
Copy link

I am facing this typescript issue, which is creating problem while deploying on vercel.

Could not find a declaration file for module 'nextra'. '//nettools/node_modules/nextra/dist/index.js' implicitly has an 'any' type.
There are types at '/
/node_modules/nextra/dist/types.d.mts', but this result could not be resolved when respecting package.json "exports". The 'nextra' library may need to update its package.json or typings.

@andrii-bodnar
Copy link

What version of Nextra are you using? Please share more details about your setup or create a minimal reproducible example.

@LuchoTurtle
Copy link

LuchoTurtle commented Jul 5, 2024

@andrii-bodnar I'm getting this exact same error, though my Nextra project, albeit small (I'm just writing a small tutorial for myself and documenting my process), needed to have authentication.

For this to happen, I quite literally used the same source code from nextra-docs-theme and put it under a theme directory and changed next.config.js so it uses this "custom" theme.

When I run pnpm run build, I have this exact error that @sarkaramitabh300 is having.

You can find the PR of my project at dwyl/nextra-demo#2, so there's an example to check out, if you want. I made some modifications to the original theme, where I wrote inside the theme/README.md file, though they are just minor adjustments to how Tailwind is imported, so nothing biggie.

I think it may be an issue with pnpm workspaces but I would really appreciate your help here :D

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

3 participants