@parcel/transformer-typescript-types: Debug Failure. Unhandled SyntaxKind: ImportClause.

See original GitHub issue

@parcel-bundler

๐ŸŽ› Configuration

package.json

{
    "source": "source/index.ts",
    "types": "dist/index.d.ts",
    "module": "dist/index.esm.js",
    "main": "dist/index.js",
    "dependencies": {
        "@swc/helpers": "^0.4.11",
        "class-validator": "^0.13.2",
        "koajax": "^0.8.1",
        "reflect-metadata": "^0.1.13",
        "regenerator-runtime": "^0.13.9",
        "web-utility": "^3.9.2"
    },
    "peerDependencies": {
        "mobx": ">=4 <6"
    },
    "devDependencies": {
        "@parcel/packager-ts": "^2.7.0",
        "@parcel/transformer-typescript-types": "^2.7.0",
        "@types/node": "^14.18.26",
        "dotenv": "^16.0.1",
        "mobx": "^5.15.7",
        "parcel": "^2.7.0",
        "typescript": "~4.8.2"
    },
    "browserslist": "> 0.5%, last 2 versions, not dead, IE 11",
    "targets": {
        "main": {
            "optimize": true
        }
    },
    "scripts": {
        "build": "rm -rf dist/ docs/  &&  parcel build"
    }
}

tsconfig.json

{
    "compilerOptions": {
        "target": "ES5",
        "module": "ES6",
        "moduleResolution": "Node",
        "esModuleInterop": true,
        "downlevelIteration": true,
        "experimentalDecorators": true,
        "emitDecoratorMetadata": true,
        "skipLibCheck": true,
        "lib": ["ES2022", "DOM", "DOM.Iterable"]
    },
    "include": ["source/*"]
}

๐Ÿค” Expected Behavior

Build TS libraries with typescript@^4.8.0 successfully.

๐Ÿ˜ฏ Current Behavior

Throw an error with typescript@4.8.2:

@parcel/transformer-typescript-types: Debug Failure. Unhandled SyntaxKind: ImportClause.

but succeed with typescript@^4.7.0.

๐Ÿ’ Possible Solution

Support ImportClause Syntax Kind.

๐Ÿ’ป Code Sample

idea2app/MobX-RESTful#6

๐ŸŒ Your Environment

Software Version(s)
Parcel 2.7.0
Node 14.19.1
PNPM 7.9.5
Operating System Windows 10 Pro 21H2

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:9
  • Comments:18 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
levinocommented, Sep 5, 2022

Using the package-lock.json or yarn.lock to pin a dependency version is abusive and dangerous. An acceptable workaround is to use yarns โ€œresolutionsโ€ field. For example in your (root when using workspaces) package.json file:

"resolutions": {
   "typescript": "~4.7"
}
2reactions
TechQuerycommented, Aug 29, 2022

@levino I think thereโ€™re Interface Breaking Changes between TS 4.7 and 4.8, which needs Parcel to adapt.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TS 4.8 Unhandled SyntaxKind: ImportClause - Stack Overflow
Apart from that this is the error info, I cannot track the file name where the issue is being raised, is there any...
Read more >
TypeScript Compiler fails with "Debug Failure. False ...
Open test.ts from the attached project. TypeScript Service and Compiler should be enabled. No errors are highlighted, Console contains the next error:
Read more >
ng build --prod error after updating to 17.1.50 | Angular
ng build --prod error after updating to 17.1.50 ... I get the following error on production build after update ... Error: Debug Failure....
Read more >
typescript fails to start with "Error: Debug Failure. False ...
I followed the insturctionon and I have failed at 'npm start' with the error, "Error: Debug Failure. False expression."
Read more >
angular/angular-cli - Gitter
ERROR in ./src/app/app.module.ts Module build failed: Error: Debug Failure. False expression: Declaration file is not present only for javascript files atย ...
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