UnhandledPromiseRejectionWarning Error
See original GitHub issueHello All,
I’m using Node 14 and seem to be running into this error when adding simple test data to solr
:
const solr = require('solr-client');
const client = solr.createClient();
client.add({ id: 12, title_t: 'Hello' }, function(err, obj) {
if (err) {
console.log(err);
} else {
console.log('Solr response:', obj);
}
}
(node:39116) UnhandledPromiseRejectionWarning: Error: Request HTTP error 404:
at Client.doRequest (…/node_modules/solr-client/dist/lib/solr.js:141:19)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
(Use node --trace-warnings ...
to show where the warning was created)
(node:39116) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:39116) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Appreciate any help. Thank you
Issue Analytics
- State:
- Created 2 years ago
- Comments:16
Top GitHub Comments
@ranrao Do you use Docker? This is how we init Solr Docker image:
Alternatively see this: https://www.tutorialspoint.com/apache_solr/apache_solr_core.htm
Thank you @kibertoad. Tried creating a Solr core and it is all working very well now. Such timely help. Really appreciate it.