solr-node-client icon indicating copy to clipboard operation
solr-node-client copied to clipboard

Build Issue: 0.10.0-RC8

Open melloware opened this issue 4 years ago • 10 comments

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.

melloware avatar Oct 10 '21 20:10 melloware

@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.

kibertoad avatar Oct 10 '21 20:10 kibertoad

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 avatar Oct 10 '21 20:10 melloware

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?

melloware avatar Oct 25 '21 12:10 melloware

@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.

kibertoad avatar Oct 25 '21 12:10 kibertoad

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

melloware avatar Oct 25 '21 12:10 melloware

Let me know if you find one :)

kibertoad avatar Oct 25 '21 12:10 kibertoad

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?

melloware avatar Oct 25 '21 12:10 melloware

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

kibertoad avatar Oct 25 '21 12:10 kibertoad

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

riccardolardi avatar Sep 13 '23 11:09 riccardolardi

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

melloware avatar Sep 13 '23 11:09 melloware