Hookyns / tst-reflect

Advanced TypeScript runtime reflection system
MIT License
340 stars 11 forks source link

parcel-transformer-ttypescript: Debug Failure #35

Open khusamov opened 2 years ago

khusamov commented 2 years ago

Hello! Great project!

But it doesn't seem to work on Parcel. I have prepared a repository in which I localized the error. https://github.com/khusamov/temp-tst-reflect-on-parcel-errors

Is there any way to fix this?

Source file:

import { getType, Type } from "tst-reflect";

interface IAnimal
{
    name: string;
}

class Animal implements IAnimal
{
    constructor(public name: string)
    {
    }
}

const typeOfIAnimal: Type = getType<IAnimal>();
const typeOfAnimal: Type = getType<Animal>();

console.log(typeOfAnimal.isAssignableTo(typeOfIAnimal)); // true

Error:

parcel-transformer-ttypescript: Debug Failure.

  Error: Debug Failure.
  at /Users/khusamov/Documents/repo/github.com/khusamov/temp-tst-reflect-on-parcel-errors/node_modules/typescript/lib/typescript.js:19675:89
  at String.replace (<anonymous>)
  at formatStringFromArgs
  (/Users/khusamov/Documents/repo/github.com/khusamov/temp-tst-reflect-on-parcel-errors/node_modules/typescript/lib/typescript.js:19675:21)
  at Object.createCompilerDiagnostic
  (/Users/khusamov/Documents/repo/github.com/khusamov/temp-tst-reflect-on-parcel-errors/node_modules/typescript/lib/typescript.js:19789:20)
  at tryReadFile
  (/Users/khusamov/Documents/repo/github.com/khusamov/temp-tst-reflect-on-parcel-errors/node_modules/typescript/lib/typescript.js:40090:40)
  at Object.readConfigFile
  (/Users/khusamov/Documents/repo/github.com/khusamov/temp-tst-reflect-on-parcel-errors/node_modules/typescript/lib/typescript.js:40055:32)
  at getConfigReflectionSection
  (/Users/khusamov/Documents/repo/github.com/khusamov/temp-tst-reflect-on-parcel-errors/node_modules/tst-reflect-transformer/dist/config.js:11:23)
  at readConfig
  (/Users/khusamov/Documents/repo/github.com/khusamov/temp-tst-reflect-on-parcel-errors/node_modules/tst-reflect-transformer/dist/config.js:27:24)
  at createConfig
  (/Users/khusamov/Documents/repo/github.com/khusamov/temp-tst-reflect-on-parcel-errors/node_modules/tst-reflect-transformer/dist/config.js:51:20)
  at Activator.prepareConfig
  (/Users/khusamov/Documents/repo/github.com/khusamov/temp-tst-reflect-on-parcel-errors/node_modules/tst-reflect-transformer/dist/contexts/TransformerContext.js:51:50)
Hookyns commented 2 years ago

Hello and TY.

I'll look into it later today or tomorrow.

buptsb commented 2 years ago

Same issue here