Closed bruno-vwds closed 2 years ago
Hello, Thanks for reporting this. Did you get this issue after upgrading to the 11.7.1 libs (that we just published), and while everything else stayed the same?
Can you try adding "node_modules/@sinequa/core/@types"
to compilerOptions.typeRoots
in your tsconfig.json
file?
Hello, Thanks for reporting this. Did you get this issue after upgrading to the 11.7.1 libs (that we just published), and while everything else stayed the same?
Hi,
Thanks for your prompt reply.
Yes, so before I was building and serving core and components libs locally, as per your docs, with Angular 13, and everything was fine. After removing core and components code, installing those packages from npm and fixing imports I started getting the errors in the issue.
Thanks.
Can you try adding
"node_modules/@sinequa/core/@types"
tocompilerOptions.typeRoots
in yourtsconfig.json
file?
Just tried this and the /// <reference types="sq-extra-typings" />
error above disappeared :raised_hands:.
However, I got more of the other errors mentioned, as you can see in the build output below:
Error: node_modules/@sinequa/core/@types/sq-extra-typings/index.d.ts:126:11 - error TS2451: Cannot redeclare block-scoped variable 'RelativeTimeFormat'.
126 class RelativeTimeFormat {
~~~~~~~~~~~~~~~~~~
node_modules/typescript/lib/lib.es2020.intl.d.ts:122:15
122 interface RelativeTimeFormat {
~~~~~~~~~~~~~~~~~~
'RelativeTimeFormat' was also declared here.
node_modules/typescript/lib/lib.es2020.intl.d.ts:176:11
176 const RelativeTimeFormat: {
~~~~~~~~~~~~~~~~~~
and here.
Error: node_modules/typescript/lib/lib.es2020.intl.d.ts:122:15 - error TS2451: Cannot redeclare block-scoped variable 'RelativeTimeFormat'.
122 interface RelativeTimeFormat {
~~~~~~~~~~~~~~~~~~
node_modules/@sinequa/core/@types/sq-extra-typings/index.d.ts:126:11
126 class RelativeTimeFormat {
~~~~~~~~~~~~~~~~~~
'RelativeTimeFormat' was also declared here.
Error: node_modules/typescript/lib/lib.es2020.intl.d.ts:176:11 - error TS2451: Cannot redeclare block-scoped variable 'RelativeTimeFormat'.
176 const RelativeTimeFormat: {
~~~~~~~~~~~~~~~~~~
node_modules/@sinequa/core/@types/sq-extra-typings/index.d.ts:126:11
126 class RelativeTimeFormat {
~~~~~~~~~~~~~~~~~~
'RelativeTimeFormat' was also declared here.
So, we're getting close-ish 😆
Could this be related with typescript versions?
I think this is because you are using "es2020" in compilerOptions.lib. Try using "es2018" instead ? (this "extra typing" file were added by us because it was not yet available at the time; but with es2020 it becomes redundant)
I think this is because you are using "es2020" in compilerOptions.lib. Try using "es2018" instead ? (this "extra typing" file were added by us because it was not yet available at the time; but with es2020 it becomes redundant)
It worked! 🙌
Thank you for your help!!!
Hi there,
I am refactoring an app that was created using your Sinequa Angular SBA workspace to use your @sinequa/core and @sinequa/components npm packages.
I'm getting the following errors after building my app:
Environment:
Dependencies (taken from the project's
package.json
):My tsconfig.json file:
My
angular.json
file:Has anyone faced this issue?