algolia / angular-instantsearch

⚡️Lightning-fast search for Angular apps, by Algolia
https://algolia.com/doc/deprecated/instantsearch/angular/v4/api-reference/instantsearch/
MIT License
261 stars 73 forks source link

[Error] angular universal on local build #725

Closed developersatish closed 3 years ago

developersatish commented 4 years ago

I am using angular/universal to make my page seo friendly. But integration of angular-instasearch is not compiling properly.

Angular version: 9

**\webapp\dist\webapp\server\main.js:221054
const searchClient = algoliasearch_1.default('CLYDS6ZPL5', '3593c6f149d018f1a165af819f1a6fcb');
                                            ^

TypeError: algoliasearch_1.default is not a function
    at Object../src/app/home/home.component.ts (**\webapp\dist\webapp\server\main.js:221054:45)
    at __webpack_require__ (**\webapp\dist\webapp\server\main.js:20:30)
    at Object../src/app/app-routing.module.ts (***\webapp\dist\webapp\server\main.js:220824:26)
    at __webpack_require__ (**\webapp\dist\webapp\server\main.js:20:30)
    at Object../src/app/app.module.ts (**\webapp\dist\webapp\server\main.js:220900:30)
    at __webpack_require__ (**\webapp\dist\webapp\server\main.js:20:30)
    at Object../src/app/app.server.module.ts (**\webapp\dist\webapp\server\main.js:220965:22)
    at __webpack_require__ (**\webapp\dist\webapp\server\main.js:20:30)
    at Object../src/main.server.ts (**\webapp\dist\webapp\server\main.js:221139:27)
    at __webpack_require__ (**\webapp\dist\webapp\server\main.js:20:30)

A server error has occurred.
node exited with 1 code.
connect ECONNREFUSED 127.0.0.1:57145
Haroenv commented 4 years ago

Hi @developersatish, We don't officially support Angular yet, but this seems to be something related to TypeScript, could you show your full application somewhere? I think this is likely related to "synthetic defaults", a TypeScript feature. Which versions for algoliasearch & InstantSearch are you using?

tkrugg commented 3 years ago

Starting 4.x.x Angular 10+ are supported.