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.

`client` and `theme` are not `exported` from `exports` field in `package.json`

See original GitHub issue

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch vitepress@1.0.0-alpha.4 for the project I’m working on.

Here is the diff that solved my problem:

diff --git a/node_modules/vitepress/package.json b/node_modules/vitepress/package.json
index bc579de..68da516 100644
--- a/node_modules/vitepress/package.json
+++ b/node_modules/vitepress/package.json
@@ -12,7 +12,9 @@
       "import": "./dist/node/index.js",
       "require": "./dist/node-cjs/index.cjs"
     },
-    "./dist/client/*": "./dist/client/*"
+    "./dist/client/*": "./dist/client/*",
+    "./client": "./client.d.ts",
+    "./theme": "./theme.d.ts"
   },
   "bin": {
     "vitepress": "bin/vitepress.js"

This issue body was partially generated by patch-package.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
brc-ddcommented, Jul 4, 2022

Besides, export const VPHomeHero = ComponentOptions in theme.d.ts seems absolutely wrong, actually, it should be export const VPHomeHero: ComponentOptions, should I fix this in the same PR or a separated one?

This is fixed on vite 3 branch.

0reactions
JounQincommented, Jul 4, 2022

This is fixed on vite 3 branch.

Glad to hear.


@brc-dd

Besides, do you think is there any chance how can I apply to be a member or collaborator or vite/vitepress groups? I’d like to spend more time working on vite/vitepress in the next few days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node: Exports field in package.json is not working
I couldn't get exports to work. This is how I worked around it. I had to change the build + publish only the...
Read more >
Package exports - webpack
The exports field in the package.json of a package allows to declare which module should be used when using module requests like import...
Read more >
import - JavaScript - MDN Web Docs - Mozilla
The static import declaration is used to import read-only live bindings which are exported by another module. The imported bindings are ...
Read more >
Requested module does not provide export named 'default'
To solve the error "The requested module does not provide an export named default", use the `default` keyword when exporting a value from...
Read more >
Example Code To Simplify Your Imports and Exports
Unique plugin or theme requirements often necessitate such code. ... If export file could not be found, write to error log. error_log("Could not...
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