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

Regression bug 0.32.19 #808

Closed
mikicho opened this issue Mar 25, 2024 · 2 comments · Fixed by #810
Closed

Regression bug 0.32.19 #808

mikicho opened this issue Mar 25, 2024 · 2 comments · Fixed by #810

Comments

@mikicho
Copy link

mikicho commented Mar 25, 2024

I have encountered a bug when using version 0.32.19, but version 0.32.15 works without any issues.

➜ bcf-typebox git:(Michael/upgrade-all) ✗ npx tsc node_modules/@sinclair/typebox/build/import/value/delta/delta.d.mts:4:37 - error TS2307: Cannot find module 'src/type/object/object.mjs' or its corresponding type declarations.

4 export declare const Insert: import("src/type/object/object.mjs").TObject<{
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@sinclair/typebox/build/import/value/delta/delta.d.mts:10:37 - error TS2307: Cannot find module 'src/type/object/object.mjs' or its corresponding type declarations.

10 export declare const Update: import("src/type/object/object.mjs").TObject<{
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@sinclair/typebox/build/import/value/delta/delta.d.mts:16:37 - error TS2307: Cannot find module 'src/type/object/object.mjs' or its corresponding type declarations.

16 export declare const Delete: import("src/type/object/object.mjs").TObject<{
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@sinclair/typebox/build/import/value/delta/delta.d.mts:21:35 - error TS2307: Cannot find module 'src/type/union/union-type.mjs' or its corresponding type declarations.

21 export declare const Edit: import("src/type/union/union-type.mjs").TUnion<[import("src/type/object/object.mjs").TObject<{
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Found 4 errors in the same file, starting at: node_modules/@sinclair/typebox/build/import/value/delta/delta.d.mts:4

tsconfig.json

{
  "compilerOptions": {
    "lib": ["ESNext", "DOM"],
    "moduleResolution": "NodeNext",
    "module": "NodeNext",
    "target": "ESNext",
    "resolveJsonModule": true,
    "incremental": true,
    // Tells TypeScript to read JS files, as
    // normally they are ignored as source files
    "allowJs": true,
    "checkJs": true,
    "strict": true,
    // Generate d.ts files
    "declaration": true,
    // This compiler run should
    // only output d.ts files
    "emitDeclarationOnly": true,
    // Types should go into this directory.
    // Removing this would place the .d.ts files
    // next to the .js files
    "outDir": "types",
    // go to js file when using IDE functions like
    // "Go to Definition" in VSCode
    "declarationMap": true
  },
  "include": ["src/**/*.js"]
}
@sinclairzx81
Copy link
Owner

@mikicho Hi, thanks for reporting.

This looks like a TypeScript compiler regression between version "^5.3.3" and "^5.4.2" (which is a bit scary). Downgrading the TypeScript compiler to 5.3.3 and building the project generates the correct import paths.

This is a bit of a serious issue, but will spend some time trying to work through a solution on 5.4.2. Failing this, I will publish a new build on 0.32.20 using the TypeScript 5.3.3 compiler.

Will keep you posted!

@sinclairzx81
Copy link
Owner

@mikicho Hi!

Have published a patch on 0.32.20 (using a workaround on the TS 5.4.2 compiler). It looks like the issue was isolated to the delta.ts module, but if you still notice any issues elsewhere, feel free to ping on this thread and can re-open and investigate further.

Also, again, thank you so much for reporting! This one is a bit of a major, I may do some further digging on the TS side.
All the best!
S

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

Successfully merging a pull request may close this issue.

2 participants