"TypeError: Cannot read property 'replace' of undefined" on running the cli `query` command with several SQL statements
See original GitHub issueIssue type:
[x] bug report [ ] feature request [ ] documentation issue
Database system/driver:
[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql
/ mariadb
[ ] oracle
[x] postgres
[ ] cockroachdb
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo
TypeORM version:
[x] latest
[ ] @next
[ ] 0.x.x
(or put your version here)
Steps to reproduce or a small repository showing the problem:
On running the cli query
command with several SQL statements all wrapped with double quotes I receive the following error from the cli-highlight:
> ts-node -r tsconfig-paths/register ./node_modules/typeorm/cli --config ormconfig-migrations.ts "query" "SELECT * FROM folder;
SELECT * FROM sub_folder;"
Running query: SELECT * FROM folder;
SELECT * FROM sub_folder;
Query has been executed. Result:
Error during query execution:
TypeError: Cannot read property 'replace' of undefined
at escape (/usr/src/app/node_modules/highlight.js/lib/highlight.js:71:18)
at Object.highlight (/usr/src/app/node_modules/highlight.js/lib/highlight.js:799:18)
at Object.highlight (/usr/src/app/node_modules/cli-highlight/src/index.ts:97:21)
at Function.PlatformTools.highlightJson (/usr/src/app/src/platform/PlatformTools.ts:221:16)
at Object.<anonymous> (/usr/src/app/src/commands/QueryCommand.ts:55:39)
at step (/usr/src/app/node_modules/typeorm/node_modules/tslib/tslib.js:141:27)
at Object.next (/usr/src/app/node_modules/typeorm/node_modules/tslib/tslib.js:122:57)
at fulfilled (/usr/src/app/node_modules/typeorm/node_modules/tslib/tslib.js:112:62)
at processTicksAndRejections (internal/process/task_queues.js:85:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sindy@1.0.0 typeorm: `ts-node -r tsconfig-paths/register ./node_modules/typeorm/cli --config ormconfig-migrations.ts "query" "SELECT * FROM folder;
npm ERR! SELECT * FROM sub_folder;"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sindy@1.0.0 typeorm script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-08-24T13_13_49_857Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sindy@1.0.0 rls:on: `bash src/policies/enable-rls.sh`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sindy@1.0.0 rls:on script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-08-24T13_13_49_873Z-debug.log
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
TypeError: Cannot read property 'replace' of undefined - Not ...
typescript - TypeError: Cannot read property 'replace' of undefined - Not sure where it's originating as I don't use replace in the repo...
Read more >[SOLVED] Cannot Read Property 'replace' of Undefined in JS
To fix the “cannot read property 'replace' of undefined” error, perform an undefined check on the variable before calling the replace() method ......
Read more >Sequelize CLI : cannot read property 'replace' of undefined ...
Coding example for the question Sequelize CLI : cannot read property 'replace' of undefined when migrating DB-sequelize.js.
Read more >error: cannot read property 'replace' of undefined sequelize
The "Cannot read property 'replace' of undefined" error occurs when calling the `replace()` method on a variable that stores an `undefined` value. To...
Read more >Database Engine events and errors - SQL Server
Consult this MSSQL error code list to find explanations for error ... A column cannot be assigned more than one value in the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Also having this issue, are there any workarounds?
I also have this problem, is it possible to re-open the issue?