valor-software / ngx-bootstrap

Fast and reliable Bootstrap widgets in Angular (supports Ivy engine)
https://valor-software.com/ngx-bootstrap
MIT License
5.53k stars 1.69k forks source link

'unsafe-eval' CSP problem with bs-modal #5196

Open WuglyakBolgoink opened 5 years ago

WuglyakBolgoink commented 5 years ago

Hallo guys,

I have some problem with my CSP-Rules with AOT compilation...

ERROR EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'".

I think, I have same error as in https://github.com/valor-software/ngx-bootstrap/issues/1242 but with "ngx-bootstrap": "4.1.1"

"dependencies": {
        "@angular/animations": "7.2.14",
        "@angular/common": "7.2.14",
        "@angular/compiler": "7.2.14",
        "@angular/core": "7.2.14",
        "@angular/forms": "7.2.14",
        "@angular/http": "7.2.14",
        "@angular/platform-browser": "7.2.14",
        "@angular/platform-browser-dynamic": "7.2.14",
        "@angular/router": "7.2.14",
        "bootstrap": "4.2.1",
        "classlist.js": "1.1.20150312",
        "core-js": "2.6.5",
        "jquery": "3.4.1",
        "ngx-bootstrap": "4.1.1",
        "rxjs": "6.5.1",
        "tslib": "1.9.3",
        "web-animations-js": "2.3.1",
        "zone.js": "0.8.26"
    },
    "devDependencies": {
        "@angular-devkit/build-angular": "0.13.8",
        "@angular/cli": "7.3.8",
        "@angular/compiler-cli": "7.2.14",
        "@angular/language-service": "7.2.14",
        "@babel/core": "7.4.4",
        "@commitlint/cli": "7.5.2",
        "@commitlint/config-angular": "7.5.0",
        "@commitlint/config-conventional": "7.5.0",
        "@ngrx/schematics": "7.4.0",
        "@ngx-rocket/scripts": "3.0.2",
        "codelyzer": "5.0.1",
        "commander": "2.20.0",
        "content-security-policy-builder": "2.0.0",
        "ts-node": "8.1.0",
        "tslint": "5.16.0",
        "typescript": "3.2.4",
        "webpack-bundle-analyzer": "3.3.2",
    }
ludmilanesvitiy commented 5 years ago

@WuglyakBolgoink Hi! Is this issue still happens with 5.2.0? If so, could you create a reproduction via Stackblitz?