升级打字稿版本后,如何为打字稿^ 3.7.3中的SSR测试修复“ undefined at printErrorAndExit”?

我在Typescript升级方面遇到问题。

这是我的问题/升级方案:

    打字稿 3.5.2 升级到 3.7.3 使用 ts-node node --require ./tsnode.js ./ssr-test/tests.ts 执行的
  • ssr测试
  • 反应组件库
  • 升级打字稿库后的主要代码更新是替换ComponentProps类型的此导入导出...
import { ComponentProps } from './component/component'
export type ComponentProps = ComponentProps
  • ...通过这种方式
export { ComponentProps } from './component/component'

这是问题所在

$ node --require ./tsnode.js ./ssr-test/tests.ts
/PROJECT/ssr-test/tests.ts:20
            throw err;
            ^

ConsoleError: undefined
    at printErrorAndExit (/PROJECT/node_modules/source-map-support/source-map-support.js:464:13)
    at process.emit (/PROJECT/node_modules/source-map-support/source-map-support.js:481:16)
    at process._fatalException (internal/process/execution.js:150:25)
error Command failed with exit code 7.

,这是 tests.ts 的一部分:


require('@babel/register')({
  compact: false
})
class ConsoleError extends Error {}

if (global.console) {
  const throws = (message,...rest) => {
    if (!(message instanceof ConsoleError)) {
      const err = new ConsoleError(format(message,...rest))
      Error.captureStackTrace(err,throws)
      throw err
    }
  }

  global.console = {
    ...global.console,error: throws,warn: throws,exception: throws
  }
}

该文件负责验证SSR的组件库。

但是升级后,我无法继续工作了。

想法?很高兴也提供了更多信息,尽管目前我不知道要添加什么。感谢您的支持。

chenelaine 回答:升级打字稿版本后,如何为打字稿^ 3.7.3中的SSR测试修复“ undefined at printErrorAndExit”?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2957835.html

大家都在问