I am using some old module: angular-2-local-storage
.
The way it's being instantiated is the following:
const LOCAL_STORAGE_SERVICE_CONFIG_TOKEN: string = 'LOCAL_STORAGE_SERVICE_CONFIG';
export const LOCAL_STORAGE_SERVICE_CONFIG = new OpaqueToken(LOCAL_STORAGE_SERVICE_CONFIG_TOKEN);
... and further in my code:
@NgModule({
.....
providers: [
LocalStorageService,
{
provide: LOCAL_STORAGE_SERVICE_CONFIG,
useValue: { prefix: 'miswap' }
},
{
But when building my project, I receive this:
Error: Error encountered resolving symbol values statically. Only initialized variables and constants can be referenced because the value of this variable is needed by the template compiler (position 2:22 in the original .ts file), resolving symbol LOCAL_STORAGE_SERVICE_CONFIG in ....
This is where I am totally lost.
The issue looks like OpaqueToken deprecation as mentioned here. However, my project is Angular 2, not 4.
So, do I miss something? Is this because of some angular cli version wrong? Don't even know where to find solution!
This is part of my package.json
if that might help:
"devDependencies": {
"@angular/compiler-cli": "^2.0.0",
"@angular/platform-server": "2.0.0",
"@angular/tsc-wrapped": "0.3.0",
"@types/async": "2.0.31",
"@types/core-js": "0.9.32",