-
Notifications
You must be signed in to change notification settings - Fork 408
Closed
TanStack/form
#631Labels
enhancementNew feature or requestNew feature or request
Description
Duplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Current behavior 😯
@solidjs/start currently points to .ts and .tsx files for resolving type information.
"types": "./shared/index.tsx",
"exports": {
".": "./shared/index.tsx",
"./config": "./config/index.js",
"./server": "./server/index.tsx",
"./server/spa": "./server/spa/index.tsx",
"./client": "./client/index.tsx",
"./client/islands": "./client/islands.tsx",
"./middleware": "./server/middleware.ts",
"./client/spa": "./client/spa/index.tsx"
},
"typesVersions": {
"*": {
".": [
"./shared/index.tsx"
],
"./server": [
"./server/index.tsx"
],
"./client": [
"./client/index.tsx"
]
}
},Using source .ts files makes skipLibCheck ineffective, leading to errors like this
node_modules/.pnpm/@solidjs+start@0.4.4_rollup@2.79.1_solid-js@1.8.8_vinxi@0.1.1_vite@4.5.1/node_modules/@solidjs/start/shared/dev-overlay/CodeView.tsx:59:18 - error TS2532: Object is possibly 'undefined'.
59 const lang = props.fileName
~~~~~~~~~~~~~~
60 .split(/[#?]/)[0]
~~~~~~~~~~~~~~~~~~~~~~~
node_modules/.pnpm/@solidjs+start@0.4.4_rollup@2.79.1_solid-js@1.8.8_vinxi@0.1.1_vite@4.5.1/node_modules/@solidjs/start/shared/dev-overlay/CodeView.tsx:80:11 - error TS18048: 'el' is possibly 'undefined'.
80 el.innerHTML = `<mark style="background-color:#aaaaaa80">${el.innerHTML}</mark>`;
~~
node_modules/.pnpm/@solidjs+start@0.4.4_rollup@2.79.1_solid-js@1.8.8_vinxi@0.1.1_vite@4.5.1/node_modules/@solidjs/start/shared/dev-overlay/CodeView.tsx:80:70 - error TS18048: 'el' is possibly 'undefined'.
80 el.innerHTML = `<mark style="background-color:#aaaaaa80">${el.innerHTML}</mark>`;
~~
node_modules/.pnpm/@solidjs+start@0.4.4_rollup@2.79.1_solid-js@1.8.8_vinxi@0.1.1_vite@4.5.1/node_modules/@solidjs/start/shared/dev-overlay/get-source-map.ts:14:20 - error TS2532: Object is possibly 'undefined'.
14 const result = lines[i].match(SOURCEMAP_REGEX);
~~~~~~~~
Expected behavior 🤔
.d.ts files should be built and pointed to in types, exports and typesVersions in package.json.
Source files should still be pointed to for conditional exports such as import and export.
Prior art includes Solid Router and Kobalte.
Steps to reproduce 🕹
Steps:
- Open stackblitz
- Wait for packages to install
- Run
pnpm tsc - Observe a lot of errors from
@solidjs/routereven thoughskipLibCheckis enabled
Context 🔦
I like doing monorepo-wide typechecking with pnpm tsc -b, but these errors get in the way. I can just run the command from packages that don't depend on @solidjs/start in the meantime.
Your environment 🌎
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request