Open lighth7015 opened 9 months ago
Hmm, thanks.
Could you provide a reproduction, or just the code you're using to implement Alias HQ in Solid?
@davestewart you just need to import
the package to get this error when using TypeScript (example below with VS Code):
For types to work properly when using ESM import
, you need to remove exports
from package.json
and add a main
property:
diff --git a/node_modules/alias-hq/package.json b/node_modules/alias-hq/package.json
index b9e233a..17c9f15 100644
--- a/node_modules/alias-hq/package.json
+++ b/node_modules/alias-hq/package.json
@@ -3,12 +3,8 @@
"version": "6.2.3",
"description": "The end-to-end solution for configuring, refactoring, maintaining and using path aliases",
"bin": "bin/alias-hq",
- "exports": {
- ".": "./src/index.js",
- "./init": "./src/plugins/module-alias/init.js",
- "./package.json": "./package.json"
- },
"types": "types",
+ "main": "./src/index.js",
"files": [
"src/*",
"cli/*",
npx patch-package alias-hq --exclude 'nothing'
(--exclude 'nothing'
is required when patching package.json
)
A better solution would be to export and support types for CommonJS and ESM.
You can find a good explanation of what's going on here.
Hi, when trying to use this with a SolidJS project, I'm receiving the following typescript error-