capi icon indicating copy to clipboard operation
capi copied to clipboard

typescript diagonostic codes not properly thrown during `capi sync`

Open ryanleecode opened this issue 2 years ago • 1 comments

I was running capi sync in a react-native project and it failed with

➜  capi-react-native-example git:(feat/rollup) ✗ npm run sync

> [email protected] sync
> capi sync node

(node:17091) ExperimentalWarning: Custom ESM Loaders is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
file:///home/ryan/Documents/Repositories/capi-vite-example/capi-react-native-example/node_modules/capi/esm/deps_2/deno.land/x/[email protected]/command/command.js:908
                : new Error(`[non-error-thrown] ${error}`));
                  ^

Error: [non-error-thrown] [object Object]
    at Command.handleError (file:///home/ryan/Documents/Repositories/capi-vite-example/capi-react-native-example/node_modules/capi/esm/deps_2/deno.land/x/[email protected]/command/command.js:908:19)
    at Command.parseCommand (file:///home/ryan/Documents/Repositories/capi-vite-example/capi-react-native-example/node_modules/capi/esm/deps_2/deno.land/x/[email protected]/command/command.js:595:18)

Node.js v20.3.1

throwing a non-error. editing the transpiled javascript to print out what the actual error was produced:

{ diagnosticCodes: [ 2307 ] }

Which seems to be TS2307 - cannot find module for local file.


Could be a cliffy issue and not a capi issue since theres no stacktrace relating to capi, only cliffy.

ryanleecode avatar Jul 14 '23 18:07 ryanleecode

Adding this to tsconfig fixes it

  "module": "ESNext",
  "moduleResolution": "node16"

ryanleecode avatar Jul 17 '23 15:07 ryanleecode