Closed urielzen closed 9 months ago
Related to https://github.com/microsoft/TypeScript/issues/37888
As a workaround, you can set declarations
to false
in the library's tsconfig
if it's not buildable.
Related to microsoft/TypeScript#37888
As a workaround, you can set
declarations
tofalse
in the library'stsconfig
if it's not buildable.
@markostanimirovic Will this be a problem for buildable libs?
Related to microsoft/TypeScript#37888 As a workaround, you can set
declarations
tofalse
in the library'stsconfig
if it's not buildable.@markostanimirovic Will this be a problem for buildable libs?
Yes, because they need declarations.
In the meantime, I found a workaround for this bug. PR with the fix will be raised soon.
Marko's fix has been released with 17.0.1
on npm
I just wanted to mention my mistake, because I got the same error when refactoring from a component-store to signalstore. Maybe it helps someone, because it was a tricky one to find, as the error appears on the store class and not on the return.
When I transferred some updaters I once forgot to change the return into patchstate.
return { ...store, counter:1};
to patchState(store, { counter:1 });
If a function, that is returned by withMethods, returns the store, this leads to the same error.
The issue exists if you're also trying to extend a store:
export function createExtendedStore() {
const Store = signalStore(withState({ foo: 'bar' }));
@Injectable()
class ExtendedStore extends Store {}
return ExtendedStore;
}
We will try to determine if it makes sense to open a feature request or if we can do some other workaround.
+1 I'm experiencing this in v18.0.2
I've disabled the declaration
and declarationMap
of my tsconfig.lib.json
in the meantime.
@matheo, @rhutchison, thanks for reporting. Since extending classes seems to be a new error, I've opened a new issue in #4489
@matheo @rhutchison I've found yet another workaround - you can give it a shot https://github.com/ngrx/platform/issues/4489#issuecomment-2291133015
Which @ngrx/* package(s) are the source of the bug?
signals
Minimal reproduction of the bug/regression with instructions
Copy the code from the ngrx/signals anouncement: Announcing NgRx v17: Introducing NgRx Signals
Expected behavior
I am working in an Nx mono repo. If I add the store ts file directly in the app (
apps
folder), the error is not present. The error only happens when the file is created in an nx library (libs
folder).This works correctly.
This does not work.
Versions of NgRx, Angular, Node, affected browser(s) and operating system(s)
ngrx/signals: v17.0.0 Angular: v17.0.1 Nx: v17.1.2 Node: v18.17.1
Other information
No response
I would be willing to submit a PR to fix this issue