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

Export ParsedContent types #2349

Closed
cco3 opened this issue Sep 28, 2023 · 6 comments · Fixed by #2773
Closed

Export ParsedContent types #2349

cco3 opened this issue Sep 28, 2023 · 6 comments · Fixed by #2773
Labels
enhancement New feature or request

Comments

@cco3
Copy link

cco3 commented Sep 28, 2023

Is your feature request related to a problem? Please describe

Right now, the types in @nuxt/content/dist/runtime/types are not available in the package.json exports. This makes the eslint resolver choke when following the approach described in the docs.

import type { MarkdownParsedContent } from '@nuxt/content/dist/runtime/types'
[eslint]   1:1  error    Resolve error: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './' is not defined by "exports" in /home/user/project/node_modules/@nuxt/content/package.json
[eslint]     at new NodeError (node:internal/errors:405:5)
[eslint]     at exportsNotFound (node:internal/modules/esm/resolve:359:10)
[eslint]     at packageExportsResolve (node:internal/modules/esm/resolve:695:9)
[eslint]     at resolveExports (node:internal/modules/cjs/loader:567:36)
[eslint]     at Module._findPath (node:internal/modules/cjs/loader:636:31)
[eslint]     at findModulePath (/home/user/project/node_modules/eslint-import-resolver-alias/index.js:99:27)
[eslint]     at exports.resolve (/home/user/project/node_modules/eslint-import-resolver-alias/index.js:75:10)
[eslint]     at withResolver (/home/user/project/node_modules/eslint-module-utils/resolve.js:114:23)
[eslint]     at fullResolve (/home/user/project/node_modules/eslint-module-utils/resolve.js:135:22)
[eslint]     at relative 

Describe the solution you'd like

Add these types to the rest of the exported types (found at @nuxt/content/dist/types.d.ts)

@cco3 cco3 added the enhancement New feature or request label Sep 28, 2023
@cco3 cco3 changed the title Export types Export ParsedContent types Sep 28, 2023
@Barbapapazes Barbapapazes mentioned this issue Nov 10, 2023
7 tasks
@xarthurx
Copy link

Second this.
Really annoying since I extend the MarkdownParsedContent to many interface I'm using.

@wokalek
Copy link

wokalek commented Jun 29, 2024

Same issue

@cco3
Copy link
Author

cco3 commented Jul 3, 2024

This appears to be fixed. I can now do import type { MarkdownParsedContent } from "@nuxt/content";

@cco3 cco3 closed this as completed Jul 3, 2024
@wokalek
Copy link

wokalek commented Jul 3, 2024

Just need to update docs then

@cco3
Copy link
Author

cco3 commented Jul 3, 2024

Alright, reopening for docs

@codeofsumit
Copy link

Docs here are not yet updated
https://nuxtseo.com/docs/sitemap/guides/content

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

Successfully merging a pull request may close this issue.

4 participants