Closed juanjinario closed 3 years ago
Hi @juanjinario , I'm sorry that you're having a trouble with Angular InstantSearch and Angular 10. To be honest, we haven't properly investigated on the support for Angular 10. I hope we can come up with it soon, but I'm afraid we cannot estimate the time yet.
Could you log what you faced there? It will be helpful when we get into it.
I receive this error messages: @eunjae-lee
Package "angular-instantsearch" has an incompatible peer dependency to "@angular/core" (requires ">=5.0.0 <9.0.0" (extended), would install "10.0.5").
Package "angular-instantsearch" has an incompatible peer dependency to "@angular/common"
(requires ">=5.0.0 <9.0.0" (extended), would install "10.0.5").
Package "angular-instantsearch" has an incompatible peer dependency to "@angular/platform-browser" (requires ">=5.0.0 <9.0.0" (extended), would install "10.0.5").
Package "angular-instantsearch" has an incompatible peer dependency to "@angular/platform-browser-dynamic" (requires ">=5.0.0 <9.0.0" (extended), would install "10.0.5").
× Migration failed: Incompatible peer dependencies found.
Peer dependency warnings when installing dependencies means that those dependencies might not work correctly together.
-browser-dynamic" (requires ">=5.0.0 <9.0.0" (extended), would install "10.0.5").
I can force update with the --force flag, but I don't know if something will be damaged, I need to know if everything will work fine
This is just a warning, which is in place, since we officially only support up until angular 8. If you actually install it with --force, do you receive any errors?
We only use the Angular-instasearch widget, which could work at the moment, I need the guarantee that all the features of Algolia will work in this version (current 10) and that I will not have to return from Angular version. I cannot do a test on my production project.
ERROR in node_modules/angular-instantsearch/instantsearch/instantsearch.module.d.ts:3:23 - error TS2314: Generic type 'ModuleWithProviders<T>' requires 1 type argument(s).
3 static forRoot(): ModuleWithProviders;
~~~~~~~~~~~~~~~~~~~
node_modules/angular-instantsearch/index.d.ts:63:23 - error TS2314: Generic type 'ModuleWithProviders<T>' requires 1 type argument(s).
How to ignore it, or what I should do ?) Angular v10.0.2 angular-instantsearch v3.0.0-beta.5
@abzalzhumabaev, this one seems difficult to keep supporting older versions (pre Angular 7)
see: https://angular.io/guide/deprecations#modulewithproviders-type-without-a-generic
A solution for now should be to use https://angular.io/guide/glossary#ngcc, or if that doesn't work, something like patch-package to change:
import { CommonModule } from '@angular/common';
import { ModuleWithProviders, NgModule } from '@angular/core';
import { NgAisInstantSearch } from './instantsearch';
@NgModule({
declarations: [NgAisInstantSearch],
entryComponents: [NgAisInstantSearch],
exports: [NgAisInstantSearch],
imports: [CommonModule],
})
export class NgAisInstantSearchModule {
public static forRoot(): ModuleWithProviders {
return {
ngModule: NgAisInstantSearchModule,
providers: [],
};
}
}
to:
import { CommonModule } from '@angular/common';
import { ModuleWithProviders, NgModule } from '@angular/core';
import { NgAisInstantSearch } from './instantsearch';
@NgModule({
declarations: [NgAisInstantSearch],
entryComponents: [NgAisInstantSearch],
exports: [NgAisInstantSearch],
imports: [CommonModule],
})
export class NgAisInstantSearchModule {
public static forRoot(): ModuleWithProviders<NgAisInstantSearchModule> {
return {
ngModule: NgAisInstantSearchModule,
providers: [],
};
}
}
I've got these warnings after npm install
, with ngcc
as postinstall task:
npm WARN angular-instantsearch@2.3.0 requires a peer of @angular/common@>=5.0.0 <9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angular-instantsearch@2.3.0 requires a peer of @angular/core@>=5.0.0 <9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angular-instantsearch@2.3.0 requires a peer of @angular/platform-browser@>=5.0.0 <9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angular-instantsearch@2.3.0 requires a peer of @angular/platform-browser-dynamic@>=5.0.0 <9.0.0 but none is installed. You must install peer dependencies yourself.
Environment:
Angular CLI: 10.1.2
Node: 12.18.4
OS: linux x64
Angular: 10.1.2
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router, service-worker
Ivy Workspace: Yes
@ictus4u, those seem like warnings, and not errors. Does it actually not work or just print the warning?
Note also that you probably want to use angular-instantsearch@beta
Hello guys. Still no plan to upgrade to Angular 10+ ? It would be really appreciated . Thanks
using v3.0.0-beta.5 with angular 10.1.5 for a side project with a search functionality, no problem so far. I'm actually going to give a try to angular 11
using v3.0.0-beta.5 with angular 10.1.5 for a side project with a search functionality, no problem so far. I'm actually going to give a try to angular 11
Did v3.0.0-beta-5 worked with Angular 11? I'm looking to update to 11 too.
https://github.com/eunjae-lee/my-angular11-app
I made this simple example with angular 11 + angular InstantSearch@beta. Can you see if it works for you?
I force updated to angular 11.1.2 and the instant search is working for me.
Is this project still maintained? It's been almost a year since the last release.
Is there any plan to start supporting Angular10+? it is really needed. Thanks
Hey all! The latest contributions happen on the v4
branch, which is why the master
branch might feel left behind.
We're in the process of planning our priorities for the coming months and we'll provide official support for Angular 10+.
Hey all! The latest contributions happen on the
v4
branch, which is why themaster
branch might feel left behind.We're in the process of planning our priorities for the coming months and we'll provide official support for Angular 10+.
Should we install the package using the v4
branch to avoid issues in Angular 10+ ?
We've released 4.0.0-alpha.0
which brings basic support for Angular 10+. We'll release on this alpha
tag for further improvements.
You can install it now:
npm install angular-instantsearch@4.0.0-alpha.0
# or
yarn add angular-instantsearch@4.0.0-alpha.0
Please feel free to open issues for any bug you may encounter.
@francoischalifour just so I understand the plan here - is v3 the next version to be released as stable, or is it v4? Both are in beta/alpha currently it seems, and the v4 branch is behind the v3 one.
Long term, v4 (which is currently alpha) will provide support for Angular 10+, so it'll be the version we'll release stable in the future.
similar issue: https://github.com/algolia/angular-instantsearch/issues/813
angular-instantsearch@4.0.0-alpha.0 still requires a peer dependency of @angular/common of < 9.0.0 so like ¯_(ツ)_/¯
@cam424 please use alpha.1
@tkrugg how to install it with npm please?
npm install angular-instantsearch@4.0.0-alpha.1
@ramikhafagi96 :), make sure to remove the InstantSearch.js version in your package.json too if you're not explicitly using it
I've tried importing both 4.0.0-alpha.1 and 4.0.0-alpha.2 and both are giving me this error on build:
ERROR in ./node_modules/angular-instantsearch/fesm2015/angular-instantsearch.js Module not found: Error: Can't resolve 'algoliasearch/lite' in 'C:\projects\stash\web\node_modules\angular-instantsearch\fesm2015' @ ./node_modules/angular-instantsearch/fesm2015/angular-instantsearch.js 4:0-57 99:24-50 99:54-72 2547:30-56 2548:6-32 2549:6-24 @ ./js/app/components2/search-box/search-box.component.ts @ ./js/app/components2/components.module.ts @ ./js/app/modules/app.module.ts @ ./js/app/modules/preApp.module.js @ ./js/app/app-scripts.ts
ERROR in C:/projects/stash/cinemaweb7-v2/Cinema.Web/node_modules/angular-instantsearch/create-ssr-search-client.d.ts ERROR in C:/projects/stash/cinemaweb7-v2/Cinema.Web/node_modules/angular-instantsearch/create-ssr-search-client.d.ts(13,174): TS2694: Namespace 'algoliasearch' has no exported member 'SearchClient'.
@twawrzyczny what's in your package.json? Do you have algoliasearch@4
installed?
@twawrzyczny closing. if you're still experiencing issues feel free to reopen.
I was unable to update my Angular project to version 10 because angular-instantsearch does not allow it. The versions that I have installed are: