I was trying out the new Ngrx v17 signalStore for state management, but I am facing this issue code sample: Exported variable 'artifactSignalStore' has or is using name 'STATE_SIGNAL' from external module "(file-path)" but cannot be named. Seems like an internal import issue, is there any fix for this or should I wait for the authors of the library to roll out a fix? Any help would be appreciated!

This is the code that I am working with: `

import { signalStore, withState } from '@ngrx/signals/src';

import { ArtifactState } from '../types';

const initialState: ArtifactState = {
artifacts: [],
artifactVersions: [],
tags: [],
filteredApplications: [],
};

export const artifactSignalStore = 
signalStore(withState(initialState));`

I have tried updating @ngrx library to the latest v17. Also removing the import for 'STATE_SIGNAL' from the core library file removed the error but doesn't seem like a reliable fix.

1

There are 1 answers

0
timdeschryver On

As a workaround, you can set declarations to false in the library's tsconfig if it's not buildable.

See https://github.com/ngrx/platform/issues/4151#issuecomment-1824986319 for more info.