Cannot read property 'text' of undefined ts-node esm

Viewed 169

I'm trying to run my server locally during development. I just run my .ts files, I don't run the js files generated to my dist folder.

When I run this script though that lives in my src/client/package.json:

"start-static-server": "node --experimental-json-modules --loader ts-node/esm.mjs ../server/server.ts",

I'm getting this error. src/client/node_modules definitely has ts-node installed so not sure why this is complaining:

src/client/node_modules/ts-node/src/index.ts:594
        return [output.outputFiles[1].text, output.outputFiles[0].text]
                                      ^
TypeError: Cannot read property 'text' of undefined

src/client/tsconfig.json

{
  "compilerOptions": {
    "noEmit": false,
    "outDir": "../../dist",
    "target": "ES2020",
    "module": "esnext",
    "lib": [
      "es5",
      "es6",
      "dom"
    ],
    "typeRoots": ["node_modules/@types"],    
    "moduleResolution": "node",
    "allowJs": false,
    "jsx": "react",
    "noImplicitAny": false,
    "sourceMap": false,
    "inlineSources": false,
    "removeComments": true,
    "noUnusedLocals": false,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "preserveSymlinks": true,
    "resolveJsonModule": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true
  },
  "include": [
    "."
  ],
  "exclude": [
    "../node_modules",
    "**/node_modules/*",
    "node_modules/@types",
    "node_modules/@types/*",
    "node_modules/@types/**",
    "js/ink-config.js",
    "test/**/*",
    "ext",
    "../../dist",
    "wallaby.ts",
  ]
}
0 Answers
Related