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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

The package.json file has a bad "module" path. #43

Open
mat813 opened this issue Aug 4, 2023 · 1 comment
Open

The package.json file has a bad "module" path. #43

mat813 opened this issue Aug 4, 2023 · 1 comment

Comments

@mat813
Copy link

mat813 commented Aug 4, 2023

Hi! 馃憢

Firstly, thanks for your work on this project! 馃檪

Today I used patch-package to patch typed-html@3.0.1 for the project I'm working on.

When running vite to build, I got this error from esbuild :

[commonjs--resolver] Failed to resolve entry for package "typed-html". The package may have incorrect main/module/exports specified in its package.json.

This is because the module line does not have the correct path in package.json.

Here is the diff that solved my problem:

diff --git a/node_modules/typed-html/package.json b/node_modules/typed-html/package.json
index cd4e..beab 100644
--- a/node_modules/typed-html/package.json
+++ b/node_modules/typed-html/package.json
@@ -3,7 +3,7 @@
   "version": "3.0.1",
   "description": "TypeSafe HTML templates using TypeScript. No need to learn a template library.",
   "main": "dist/src/elements.js",
-  "module": "dist/esm/elements.js",
+  "module": "dist/esm/src/elements.js",
   "repository": {
     "type": "git",
     "url": "https://github.com/nicojs/typed-html"

This issue body was partially generated by patch-package.

@arthurfiorette
Copy link

@mat813 @kitajs/html does not have this same problem :)

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

2 participants