shlomiassaf / ngx-modialog

Modal / Dialog for Angular
http://shlomiassaf.github.io/ngx-modialog
MIT License
686 stars 242 forks source link

Cannot find module 'ngx-modialog/plugins/bootstrap'. #398

Closed czarcismok closed 6 years ago

czarcismok commented 6 years ago

Hi there! This is probably newbie mistake but I've been sitting quite a while now and I can't figure this out. I've been using angular2-modal with ease (thank You for great work! ;), but upgrade had come along with some unexpected errors. When building webpack (npm run build) I got:

ERROR in /home/[...]/src/app/app.module.ts (11,38): Cannot find module 'ngx-modialog/plugins/bootstrap'. ERROR in Error: Error encountered resolving symbol values statically. Could not resolve ngx-modialog/plugins/bootstrap relative to /home/[...]/src/app/app.module.ts., resolving symbol AppModule in /home/[...]/src/app/app.module.ts, resolving symbol AppModule in /home/[...]/src/app/app.module.ts at syntaxError (/home/[...]/node_modules/@angular/compiler/bundles/compiler.umd.js:1729:34) at simplifyInContext (/home/[...]/node_modules/@angular/compiler/bundles/compiler.umd.js:25111:23) at StaticReflector.simplify (/home/[...]/node_modules/@angular/compiler/bundles/compiler.umd.js:25123:13) at StaticReflector.annotations (/home/[...]/node_modules/@angular/compiler/bundles/compiler.umd.js:24553:41) at _getNgModuleMetadata (/home/[...]/node_modules/@angular/compiler-cli/src/ngtools_impl.js:138:31) at _extractLazyRoutesFromStaticModule (/home/[...]/node_modules/@angular/compiler-cli/src/ngtools_impl.js:109:26) at Object.listLazyRoutesOfModule (/home/[...]/node_modules/@angular/compiler-cli/src/ngtools_impl.js:53:22) at Function.NgTools_InternalApi_NG_2.listLazyRoutes (/home/[...]/node_modules/@angular/compiler-cli/src/ngtools_api.js:91:39) at AotPlugin._getLazyRoutesFromNgtools (/home/[...]/node_modules/@ngtools/webpack/src/plugin.js:207:44) at _donePromise.Promise.resolve.then.then.then.then.then (/home/[...]/node_modules/@ngtools/webpack/src/plugin.js:443:24) at process._tickCallback (internal/process/next_tick.js:109:7) at Module.runMain (module.js:607:11) at run (bootstrap_node.js:427:7) at startup (bootstrap_node.js:151:9) at bootstrap_node.js:542:3

and when I point it directly to 'ngx-modialog/plugins/bootstrap/src/bootstrap'

ERROR in Error: BootstrapModalModule is not an NgModule at _getNgModuleMetadata (/home/[...]/node_modules/@angular/compiler-cli/src/ngtools_impl.js:140:15) at _extractLazyRoutesFromStaticModule (/home/[...]/node_modules/@angular/compiler-cli/src/ngtools_impl.js:109:26) at /home/[...]/node_modules/@angular/compiler-cli/src/ngtools_impl.js:129:27 at Array.reduce (native) at _extractLazyRoutesFromStaticModule (/home/[...]/node_modules/@angular/compiler-cli/src/ngtools_impl.js:128:10) at Object.listLazyRoutesOfModule (/home/[...]/node_modules/@angular/compiler-cli/src/ngtools_impl.js:53:22) at Function.NgTools_InternalApi_NG_2.listLazyRoutes (/home/[...]/node_modules/@angular/compiler-cli/src/ngtools_api.js:91:39) at AotPlugin._getLazyRoutesFromNgtools (/home/[...]/node_modules/@ngtools/webpack/src/plugin.js:207:44) at _donePromise.Promise.resolve.then.then.then.then.then (/home/[...]/node_modules/@ngtools/webpack/src/plugin.js:443:24) at process._tickCallback (internal/process/next_tick.js:109:7) at Module.runMain (module.js:607:11) at run (bootstrap_node.js:427:7) at startup (bootstrap_node.js:151:9) at bootstrap_node.js:542:3

Any ideas?

my package.json:

{ "name": "ultra-secret-app-name", "version": "0.0.0", "license": "MIT", "scripts": { "ng": "ng", "start": "webpack-dev-server --port=4200", "build": "webpack", "test": "karma start ./karma.conf.js", "lint": "ng lint", "e2e": "protractor ./protractor.conf.js", "i18n": "ng-xi18n", "extract": "ngx-translate-extract --input ./src --output ./src/locale/*.json --clean --sort --format namespaced-json", "pree2e": "webdriver-manager update --standalone false --gecko false --quiet" }, "private": true, "dependencies": { "@angular/animations": "^4.4.3", "@angular/common": "^4.4.3", "@angular/compiler": "^4.4.3", "@angular/core": "^4.4.3", "@angular/flex-layout": "^2.0.0-beta.6", "@angular/forms": "^4.4.3", "@angular/http": "^4.4.3", "@angular/platform-browser": "^4.4.3", "@angular/platform-browser-dynamic": "^4.4.3", "@angular/platform-server": "^4.4.3", "@angular/router": "^4.4.3", "@biesbjerg/ngx-translate-extract": "^2.3.2", "@ngtools/webpack": "^1.7.1", "@ngx-translate/core": "^8.0.0", "@ngx-translate/http-loader": "^2.0.0", "@types/bootstrap-fileinput": "0.0.6", "@types/file-saver": "0.0.1", "@types/fullcalendar": "^2.7.46", "@types/jquery": "^3.2.12", "@types/node": "^7.0.43", "anytime": "^1.4.2", "bcrypt": "^1.0.3", "bootstrap": "^3.3.7", "bootstrap-fileinput": "^4.4.4", "coa": "^2.0.0", "core-js": "^2.5.1", "cryptico": "^1.0.2", "crypto": "0.0.3", "extract-text-webpack-plugin": "^3.0.0", "file-saver": "^1.3.3", "flatpickr": "^3.0.7", "fullcalendar": "^3.5.1", "localStorage": "^1.0.3", "moment": "^2.18.1", "ng-dynamic-component": "^1.1.0", "ng2-completer": "^1.6.3", "ngx-modialog": "^3.0.4", "node-gyp": "^3.6.2", "node-pre-gyp": "^0.6.38", "rxjs": "^5.4.3", "to-string-loader": "^1.1.5", "webpack": "^3.6.0", "zone.js": "^0.8.18" }, "devDependencies": { "@angular/cli": "^1.4.3", "@angular/compiler-cli": "^4.4.3", "@types/jasmine": "2.5.47", "aes-js": "^3.1.0", "angular-ide": "^0.9.23", "angular2-jwt": "^0.2.3", "autoprefixer": "^6.5.3", "bcryptjs": "^2.4.3", "circular-dependency-plugin": "^3.0.0", "codelyzer": "^3.2.0", "copy-webpack-plugin": "^4.0.1", "css-loader": "^0.28.7", "cssnano": "^3.10.0", "exports-loader": "^0.6.3", "file-loader": "^0.10.0", "html-webpack-plugin": "^2.30.1", "istanbul-instrumenter-loader": "^2.0.0", "jasmine-core": "^2.8.0", "jasmine-spec-reporter": "~4.1.0", "karma": "^1.7.1", "karma-chrome-launcher": "~2.1.1", "karma-cli": "~1.0.1", "karma-coverage-istanbul-reporter": "^1.2.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", "less-loader": "^4.0.5", "postcss-loader": "^1.3.3", "postcss-url": "^5.1.2", "pouchdb": "^6.3.4", "pouchdb-authentication": "^0.5.5", "protractor": "~5.1.2", "raw-loader": "^0.5.1", "sass-loader": "^6.0.6", "source-map-loader": "^0.2.0", "style-loader": "^0.13.1", "stylus-loader": "^3.0.1", "transform-pouch": "^1.1.3", "ts-node": "~3.0.4", "tslint": "^5.7.0", "typescript": "^2.5.3", "url-loader": "^0.5.7", "webpack-concat-plugin": "1.4.0", "webpack-dev-server": "~2.7.1" }

achimha commented 6 years ago

That's a problem with Typescript 2.5.3. If you go back to 2.5.2, it should work. I had the same issue.

czarcismok commented 6 years ago

Wow, super-fast - that was the case, now it's building. Thanks!

MartinNuc commented 6 years ago

I have similar issue on TS 2.5.2

Tried to downgrade to TS 2.3.4 but didnt help.

I use "ngx-modialog": "3.0.4"

ERROR in /Users/mist/programming/[...]/src/app/core/core.module.ts (27,38): Cannot find module 'ngx-modialog/plugins/bootstrap'.

Any idea what could be the cause?

MartinNuc commented 6 years ago

Finally it works. Forgot to remove yarn.lock ... so I probably used the wrong version.

DelphiWorlds commented 6 years ago

TS 2.5.2 fixed it for me, too