edcarroll / ng2-semantic-ui

Semantic UI Angular Integrations (no jQuery)
https://edcarroll.github.io/ng2-semantic-ui/
MIT License
615 stars 223 forks source link

Cannot find namespace 'Popper'. #355

Closed rafaelvalerini closed 6 years ago

rafaelvalerini commented 6 years ago

Bug description:

When I run ng serve, show this error:

ERROR in node_modules/ng2-semantic-ui/dist/misc/util/services/positioning.service.d.ts(35,21): error TS2503: Cannot find namespace 'Popper'.
node_modules/ng2-semantic-ui/dist/modules/sidebar/services/sidebar.service.d.ts(13,11): error TS2503: Cannot find namespace 'Popper'.
node_modules/ng2-semantic-ui/dist/modules/sidebar/services/sidebar.service.d.ts(14,12): error TS2503: Cannot find namespace 'Popper'.
node_modules/ng2-semantic-ui/dist/modules/sidebar/services/sidebar.service.d.ts(15,10): error TS2503: Cannot find namespace 'Popper'.
node_modules/ng2-semantic-ui/dist/modules/sidebar/services/sidebar.service.d.ts(16,13): error TS2503: Cannot find namespace 'Popper'.

Version of Angular, ng2-semantic-ui, and Semantic UI:

NodeJS: 7.10.1

{
  "name": "izagro",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular-devkit/core": "^0.3.1",
    "@angular/animations": "^5.2.8",
    "@angular/common": "^5.2.8",
    "@angular/compiler": "^5.2.8",
    "@angular/core": "^5.2.8",
    "@angular/forms": "^5.2.8",
    "@angular/http": "^5.2.8",
    "@angular/platform-browser": "^5.2.8",
    "@angular/platform-browser-dynamic": "^5.2.8",
    "@angular/router": "^5.2.8",
    "angular-2-dropdown-multiselect": "^1.6.0",
    "angular-input-masks": "^4.1.0",
    "angular-toastr": "^2.1.1",
    "angular2-multiselect-dropdown": "^1.3.0",
    "angular2-text-mask": "^8.0.4",
    "angular2-toaster": "^4.0.1",
    "angularx-social-login": "^1.1.7",
    "aws-sdk": "^2.180.0",
    "bootstrap": "^4.0.0-beta.3",
    "brmasker4": "^1.0.1",
    "core-js": "^2.4.1",
    "crypto-js": "^3.1.9-1",
    "moment": "^2.20.1",
    "ng-block-ui": "^1.0.0-beta.18",
    "ng2-bootstrap": "^1.6.3",
    "ng2-checklist": "^1.0.2",
    "ng2-select": "^2.0.0",
    "ng2-semantic-ui": "^0.9.6",
    "ngx-auth": "^2.2.0",
    "ngx-bootstrap": "^2.0.2",
    "rxjs": "^5.5.2",
    "zone.js": "^0.8.14"
  },
  "devDependencies": {
    "@angular/cli": "1.6.3",
    "@angular/compiler-cli": "^5.2.8",
    "@angular/language-service": "^5.2.8",
    "@types/jasmine": "~2.5.53",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "^4.0.1",
    "jasmine-core": "~2.6.2",
    "jasmine-spec-reporter": "~4.1.0",
    "karma": "~1.7.0",
    "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",
    "protractor": "~5.1.2",
    "ts-node": "~3.2.0",
    "tslint": "~5.7.0",
    "typescript": "~2.4.2"
  }
}

What am I doing wrong?

kloener commented 6 years ago

Reproducable with Popper.js v1.14.x. in 1.11.1 it worked.

frankiedrake commented 6 years ago

As a temporary solution I've solved this with npm-shrinkwrap forcing ng2-semantic-ui using popper.js version 1.12.6.

"popper.js": {
      "version": "1.12.6",
      "from": "popper.js@>=1.11.1 <2.0.0",
      "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.12.6.tgz"
    }
edcarroll commented 6 years ago

Could you try again with Popper v1.14.1? The breaking change in their library has been reverted.

rhefner commented 6 years ago

@edcarroll: I'm experiencing the same thing, even using popper@1.14.1. :( Reverting back to popper@1.12.9 (what I had before) works fine.

mojtabaasadi commented 6 years ago

I tried this: changed sidebar.service.d.ts this way

...
import {Position} from "popper.js";
...
export declare const SidebarDirection: {
    Left: Position;
    Right: Position;
    Top: Position;
    Bottom: Position;
};
...

seems popper.js @ 1.14.1 has an exported type member Position

edcarroll commented 6 years ago

Aiming to get a release out with a fix for this in it tomorrow evening. Apologies for the delay.

rhefner commented 6 years ago

Appreciate all the work you've done so far! Thank you!

On Thu, Mar 15, 2018, 1:33 PM Edward Carroll notifications@github.com wrote:

Aiming to get a release out with this in it tomorrow evening. Apologies for the delay.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/edcarroll/ng2-semantic-ui/issues/355#issuecomment-373513862, or mute the thread https://github.com/notifications/unsubscribe-auth/AHxHn-3VXlyUknGqFq8JAUkbCZHWaWGiks5tetAsgaJpZM4SnBzB .

charlenebuena commented 4 years ago

This worked for me: npm install ng2-semantic-ui@0.9.6 popper.js@1.12.9 --save