This repository was archived by the owner on Oct 2, 2022. It is now read-only.
This repository was archived by the owner on Oct 2, 2022. It is now read-only.
Misleading TypeScriptCompileError when user's tsconfig.json "module" is set to "es2015" #155
Open
Description
Description
I'm using auto (pretty cool tool) with .config.ts
and I get a crash with following error.
$ /home/hasparus/workspace/theme-ui/node_modules/.bin/auto info
TypeScriptCompileError: Failed to compile TypeScript: Unexpected token 'export'
at Function.TypeScriptCompileError.fromError (/home/hasparus/workspace/theme-ui/node_modules/@endemolshinegroup/cosmiconfig-typescript-loader/src/Errors/TypeScriptCompileError.ts:20:12)
at /home/hasparus/workspace/theme-ui/node_modules/@endemolshinegroup/cosmiconfig-typescript-loader/dist/index.js:21:48
at Generator.next (<anonymous>)
What went wrong?
ts-node/register
finds my tsconfig which isn't configured for Node- cosmiconfig-typescript-loader requires the config
- ts-node compiles the config successfuly
- Node crashes on
export
— the error is a bit misleading
What did you expect should have happened?
What was the config you used?
This one, but I'm not sure if it matters
import { AutoRc } from '@auto-it/core'
import { INpmConfig } from '@auto-it/npm'
import { IAllContributorsPluginOptions } from '@auto-it/all-contributors'
const npmOptions: INpmConfig = {
exact: true,
}
const allContributorsOptions: IAllContributorsPluginOptions = {
exclude: ['dependabot', 'dependabot-preview'],
types: {
infra: ['./github/**/*'],
example: ['examples/**/*'],
doc: ['**/*.mdx', '**/*.md', 'packages/docs/**/*'],
test: ['**/*.test.*', '**/*.spec.*'],
code: [
'packages/**/*.js',
'packages/**/*.ts',
'packages/**/*.jsx',
'packages/**/*.tsx',
'**/package.json',
'**/tsconfig.json',
],
},
}
export default function config(): AutoRc {
return {
baseBranch: 'stable',
prereleaseBranches: ['develop'],
plugins: [
['npm', npmOptions],
'conventional-commits',
'first-time-contributor',
'released',
['all-contributors', allContributorsOptions],
],
}
}
What stacktrace or error messages did you see?
Stack Trace:
$ /home/hasparus/workspace/theme-ui/node_modules/.bin/auto info
TypeScriptCompileError: Failed to compile TypeScript: Unexpected token 'export'
at Function.TypeScriptCompileError.fromError (/home/hasparus/workspace/theme-ui/node_modules/@endemolshinegroup/cosmiconfig-typescript-loader/src/Errors/TypeScriptCompileError.ts:20:12)
at /home/hasparus/workspace/theme-ui/node_modules/@endemolshinegroup/cosmiconfig-typescript-loader/dist/index.js:21:48
at Generator.next (<anonymous>)
Similar or dependent issues:
- auto.config.ts breaks when tsconfig.json "module" is "es2015" intuit/auto#1943 — I created an issue for
auto
, but the problem is not on their side.
Additional Data
Version of cosmiconfig-typescript-loader
you're using: 3.0.2
Node Version: 14.15.3
Operating System: Pop!_OS 20.04 LTS
Metadata
Metadata
Assignees
Labels
No labels