lbdremy / solr-node-client

A solr client for node.js.
http://lbdremy.github.com/solr-node-client
MIT License
494 stars 208 forks source link

Build Issue: 0.10.0-RC8 #293

Open melloware opened 3 years ago

melloware commented 3 years ago

I have a Create React App and trying to use v 0.10.8 I get these compile issues: https://github.com/nodejs/undici/discussions/1057

If I back up to your 0.9.0 version everything works fine.

./node_modules/undici/lib/api/api-request.js
Module not found: Can't resolve 'async_hooks' in 'C:\dev\aim\node_modules\undici\lib\api'

when I try npm run build i am getting this different error

Creating an optimized production build...
Failed to compile.

.\node_modules\undici\lib\fetch\request.js
Cannot find module: 'stream/web'. Make sure this package is installed.
kibertoad commented 3 years ago

@melloware So you are trying to use solr-node-client from the frontend and it used to work? Request is also node-only library, so it is interesting that it used to work. Undici is a new http client that we are using. I can try to implement fallback for frontend cases.

melloware commented 3 years ago

Exactly. I am using a React Application. I added your SOLR Client 0.10.0-RC8 and get the above compile time failures.

If I go back to your 0.9.0 my code works just fine.

melloware commented 2 years ago

I wonder if instead of fallback you should just use Axios so you have 1 lib and the code is cohesive and works on client or server?

kibertoad commented 2 years ago

@melloware undici is significantly (3-4 times) faster than axios, so I prefer using that for BE. FE is not a primary use-case for the lib.

melloware commented 2 years ago

HA is there a client side library as fast as undici? :)

kibertoad commented 2 years ago

Let me know if you find one :)

melloware commented 2 years ago

HA so I am wondering if FE is not a goal of this library should I fork it? To me its a great use case for FE as I have a dashboard hitting SOLR directly displaying information that is 20X faster than their current application which uses Python middleware. So I did a POC with solr-client and React JS and it delivered impressive results. :)

I could create a solr-browser-client library using AXIOS which could support both?

kibertoad commented 2 years ago

I suspect that would be way too much duplicated code. Let me try the axios fallback approach this week.

riccardolardi commented 1 year ago

Has there ever been continuation on this? I'm looking to use this lib on frontend too using nextjs

melloware commented 1 year ago

@riccardolardi no progress on this that I know of...