You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
By default, initializing a project with tsc --init creates a tsconfig file with a lot of comments inside. I usually leave them in. If you run the cli method yarn mikro-orm cache:generate runs into an error when comments are present.
Stack trace
(node:8435) UnhandledPromiseRejectionWarning: SyntaxError: /Users/*****/Project/Private//*****/tsconfig.json: Unexpected token/ in JSON at position 259
at parse (<anonymous>)
at Object.Module._extensions..json (internal/modules/cjs/loader.js:1234:22)
at Module.load (internal/modules/cjs/loader.js:1049:32)
at Function.Module._load (internal/modules/cjs/loader.js:937:14)
at Module.require (internal/modules/cjs/loader.js:1089:19)
at require (internal/modules/cjs/helpers.js:73:18)
at Function.registerTsNode (/Users//*****/Project/Private//*****d/node_modules/@mikro-orm/core/utils/ConfigurationLoader.js:57:30)
at Function.configure (/Users//*****/Project/Private/*****/node_modules/@mikro-orm/cli/CLIHelper.js:38:13)
at /Users//*****/Project/Private//*****/node_modules/@mikro-orm/cli/cli.js:16:1
To Reproduce
Steps to reproduce the behavior:
Create a new project and initialize it with tsc --init
Add mikro orm cli and bootstrap the app with database connection etc.
run yarn mikro-orm cache:generate
Expected behavior
Either should the error be more clear, something like The provided tsconfig is invalid. Please keep in mind that comments are not allowed or it should support comments.
Additional context
A tsconfig that allows reproduction of the issue looks like this:
Describe the bug
By default, initializing a project with
tsc --init
creates a tsconfig file with a lot of comments inside. I usually leave them in. If you run the cli methodyarn mikro-orm cache:generate
runs into an error when comments are present.Stack trace
To Reproduce
Steps to reproduce the behavior:
tsc --init
yarn mikro-orm cache:generate
Expected behavior
Either should the error be more clear, something like
The provided tsconfig is invalid. Please keep in mind that comments are not allowed
or it should support comments.Additional context
A tsconfig that allows reproduction of the issue looks like this:
Versions
The text was updated successfully, but these errors were encountered: