angular2-busy icon indicating copy to clipboard operation
angular2-busy copied to clipboard

ERROR in Error encountered resolving symbol values statically

Open lorentzyip opened this issue 8 years ago • 12 comments

Hi, I'm using [email protected] and [email protected]. I have followed the readme to customize the BusyModule in app.module as below:

import {NgModule} from '@angular/core';
import {BusyModule, BusyConfig} from 'angular2-busy';

@NgModule({
    imports: [
        // ...
        BusyModule.forRoot(
            new BusyConfig({
                message: 'Don\'t panic!',
                backdrop: false,
                template: `
                    <div>{{message}}</div>
                `,
                delay: 200,
                minDuration: 600
            })
        )
    ],
    // ...
})
export class AppModule

however, when I run the application with ng serve, I got the error: ERROR in Error encountered resolving symbol values statically. Calling function 'BusyConfig', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AppModule in C:/WebApp/src/app/app.module.ts, resolving symbol AppModule in C:/WebApp/src/app/app.module.ts, resolving symbol AppModule in C:/WebApp/src/app/app.module.ts

Please help.

lorentzyip avatar Jan 18 '17 15:01 lorentzyip

it looks like this package is not beeing updated and from what i have gathered here is the problem: angular-cli and webpack want to do some checking on the packages we use to bruild a good runtime bundle. this means that feature modules like this one need to be updated to use updated modules and to also generate a metadata json file that they can use to help the build process.

this package is one of several that have the same issues.

we can try to update this package or find a different one or fork from this one. i am looking at the options but not sure yet which way to go.

figuerres avatar Jan 25 '17 16:01 figuerres

i just started a fork from this and will see if i can update it to work with angular cli see here: https://github.com/figuerres/ng-busy give me a few days and then see if you want to add to this.

figuerres avatar Jan 25 '17 22:01 figuerres

That's great Danny! I'm looking forward to your updates.

lorentzyip avatar Jan 26 '17 11:01 lorentzyip

Any update on this one~~?

BaronChen avatar Jan 29 '17 05:01 BaronChen

@BaronChen please post on my fork if you are asking about that. Thanks.

figuerres avatar Jan 29 '17 09:01 figuerres

Has anyone fixed this bug?

marciomsm avatar Feb 14 '17 13:02 marciomsm

This week for sure I will have some time to work on this and I will check on this and the package, for now edit the feature code and skip the for root option. That's what I did in my app for now.

figuerres avatar Feb 14 '17 13:02 figuerres

Another way of getting around this problem is to typecast your object to BusyConfig.

import [
  ...
  BusyModule.forRoot(<BusyConfig>{message: 'Dont Panic! ;)', minDuration: 500})
]
        

MohibWasay avatar Mar 22 '17 12:03 MohibWasay

~~Hi, the trick / workaround proposed by @MohibWasay solved the problem in my case. Thanks @MohibWasay !~~

Eratum, finally @MohibWasay did not solve the problem, the config seems to not being taken into account with the cast in our case.

bgaillard avatar Mar 24 '17 14:03 bgaillard

any updates on this issue?

michalzfania avatar Apr 27 '17 06:04 michalzfania

Solved the problem here module.ts:

import { BusyModule, BusyConfig, BUSY_CONFIG_DEFAULTS } from 'angular2-busy';

const busyConfig: BusyConfig = {
    message: 'Processing..',
    delay: 200,
    template: BUSY_CONFIG_DEFAULTS.template,
    minDuration: BUSY_CONFIG_DEFAULTS.minDuration,
    backdrop: true,
    wrapperClass: BUSY_CONFIG_DEFAULTS.wrapperClass
};

then:

@NgModule({
    imports: [
        ...
        BusyModule.forRoot(busyConfig),
        ...
    ],

Jaimera avatar May 10 '17 17:05 Jaimera

@Jaimera It works for me :heart:

railslauncher avatar Jul 05 '17 15:07 railslauncher