Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Popper.js error #195

Closed
mvcoding opened this issue Jul 27, 2017 · 15 comments
Closed

Popper.js error #195

mvcoding opened this issue Jul 27, 2017 · 15 comments

Comments

@mvcoding
Copy link

mvcoding commented Jul 27, 2017

Bug description:

Getting this error when i want to serve my app with ng2-semantic-ui included:

node_modules/@types/popper.js/index.d.ts (104,3): Cannot redeclare exported variable 'default'.
node_modules/popper.js/index.d.ts (106,24): Cannot redeclare exported variable 'default'

It seems to be related to the recent popper.js update 1.11.0, specifically the addition of types to their package with the pull #351. Manually downgrading popper.js to the older 1.10 branch temporarily helps to avoid the error.

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

  • Angular: 4.3.1
  • ng2-semantic-ui: 0.9.3
  • Semantic UI: 2.2.11
@FezVrasta
Copy link

Is this a problem with the type definitions shipped with Popper.js or with the way the lib is used in this repo?

@mvcoding
Copy link
Author

mvcoding commented Jul 27, 2017

I think it's the latter. @types/popper.js is set as dependency in this repo which should cause the error.

@edcarroll
Copy link
Owner

Ahh ok I see whats happened. I'll now that Popper.js is including their own types I no longer need to depend on @types/popper.js. FYI the reason it's a dependency is because I re-export a couple of definitions from the lib hence the error. Will get a fix out in the next release.

@edcarroll
Copy link
Owner

Workaround for now is manually installing popper.js@1.10.8

@edcarroll
Copy link
Owner

As this is affecting quite a few people, I'm going to release a hotfix for it ASAP.

@edcarroll edcarroll modified the milestones: 0.9.4, 0.9.5 Jul 27, 2017
@FezVrasta
Copy link

@edcarroll what could have been done on Popper.js side to avoid this problem?

@edcarroll
Copy link
Owner

edcarroll commented Jul 27, 2017

@FezVrasta I've had a play with the code and what's happened is the type definitions included with popper.js are actually different to the ones in @types/popper.js. Normally when a module includes its own defs the old @types ones are ignored, however in this instance they conflicted, causing the errors to appear.

As far as I can tell the types now included in popper.js will have broken all builds requiring the old types, because the original ones allows you to write:

import Popper from "popper.js";

const myPopper = new Popper(...);

const modifiers:Popper.Modifiers = ...;

Whereas the guy that modified them in the Popper.JS PR has made it so you need to write:

import * as Popper from "popper.js";

const myPopper = new Popper.default(...);

const modifiers:Popper.Modifiers = ...;

Or (what I've done):

import Popper from "popper.js";
import * as PopperTypes from "popper.js";

const myPopper = new Popper(...);

const modifiers:PopperTypes.Modifiers = ...;

This is a step backwards, and I would recommend a new release that includes the old type definitions (as a patch release, which then wouldn't require a major version change, which these included types should originally have included)

@edcarroll
Copy link
Owner

@FezVrasta it wouldn't let me tag you in my previous comment, not sure why. Here is the tag anyway

@FezVrasta
Copy link

ping @giladgray, may you work on this?

@edcarroll
Copy link
Owner

@FezVrasta I'm happy to sort this out in a PR, as there are also a couple of other things missing in the type definitions that I'd like to fix 😄

@edcarroll
Copy link
Owner

@FezVrasta have just opened a PR that fixes the issues I've mentioned above.

@edcarroll
Copy link
Owner

0.9.4 is now live which locks down the Popper dependencies for now. @mvcoding this will sort out your build.

@mvcoding
Copy link
Author

Great, thanks for the quick fix!

edcarroll added a commit that referenced this issue Aug 10, 2017
mcosta74 pushed a commit that referenced this issue Aug 11, 2017
mcosta74 pushed a commit that referenced this issue Aug 14, 2017
* fix: Fixed AOT on SystemJS builder

Closes #209

* fix: Added custom FocusEvent interface (#231)

* fix: Added custom FocusEvent interface

Closes #202

FocusEvent isn't defined in UC browser, so added IFocusEvent with the property we need.

* style(util): Fixed tslint error

* chore(popup): Relaxed popper.js dependency (#228)

Follows up on #195

* fix(popup): Fixed delay causing destroyed view errors (#233)

Closes #189

* fix(select): Manually run change detector when option updates (#236)

* fix(select): Manually run change detector when option updates

Closes #213

* style(select): Fixed tslint error

* fix(select): Selected options now updated when options change (#232)

* fix(modal): Fixed aggressive autofocus sometimes causing errors (#237)

* fix(popup): Fixed conflict with BrowserAnimationsModule (#234)

* fix(popup): Fixed conflict with BrowserAnimationsModule

Closes #204

* style(popup): Fixed tslint error

* feat(popup): Added template context support (#238)

* fix(popup): Fixed focus events on popup (#243)

* feat(datepicker) Popup now honors locale and pickerLocaleOverrides (#215)

* Datepicker popup now honors locale and pickerLocaleOverrides

- Datepicker popup items now respect locale format
- Fixed a bug in zoom calendar mapping for datetime datepicker
- Fixed 'es' locale for consistency

(*) Partially addresses #164

* Added comments.

* Time of day values supported in locale definitions (#214)

* en-GB and en-US locales now use 12 hour format

Original "HH:mm" (23:59) -> Now "hh:mm aa" (11:59 p.m.)

* Fix locales Russian, Italian and Hebrew now extend from ILocaleValues.

* Added new IDatepickerFormatsLocaleValues fields:
- timesOfDay
- timesOfDayUppercase
- timesOfDayLowercase
to support proper formatting/parsing of dates in datepicker.

Updated Localization page

* Fixing code formatting

* feat(datepicker) Added initial date support for the datepicker (#216)

* feat(datepicker) New input pickerInitialDate

- New input (optional) that sets the intial date to display (null = today)
- Updated demo page

Partially addresses #165

* Now pickerInitialDate only sets CalendarService.currentDate property

* feat(datepicker): Initial date support
- Code formatting

* fix: Various minor bugfixes (#245)

* fix(select): Fixed destroyed view errors

* fix(modal): Fix modal auto closing when clicked

* fix(popup): Removed console log in focus handler

* fix(popup): Forced import of TemplateRef

* fix: Fixed AOT on SystemJS builder

Closes #209
gotenxds pushed a commit to gotenxds/ng2-semantic-ui that referenced this issue Aug 15, 2017
gotenxds pushed a commit to gotenxds/ng2-semantic-ui that referenced this issue Aug 15, 2017
gotenxds pushed a commit to gotenxds/ng2-semantic-ui that referenced this issue Aug 15, 2017
* fix: Fixed AOT on SystemJS builder

Closes edcarroll#209

* fix: Added custom FocusEvent interface (edcarroll#231)

* fix: Added custom FocusEvent interface

Closes edcarroll#202

FocusEvent isn't defined in UC browser, so added IFocusEvent with the property we need.

* style(util): Fixed tslint error

* chore(popup): Relaxed popper.js dependency (edcarroll#228)

Follows up on edcarroll#195

* fix(popup): Fixed delay causing destroyed view errors (edcarroll#233)

Closes edcarroll#189

* fix(select): Manually run change detector when option updates (edcarroll#236)

* fix(select): Manually run change detector when option updates

Closes edcarroll#213

* style(select): Fixed tslint error

* fix(select): Selected options now updated when options change (edcarroll#232)

* fix(modal): Fixed aggressive autofocus sometimes causing errors (edcarroll#237)

* fix(popup): Fixed conflict with BrowserAnimationsModule (edcarroll#234)

* fix(popup): Fixed conflict with BrowserAnimationsModule

Closes edcarroll#204

* style(popup): Fixed tslint error

* feat(popup): Added template context support (edcarroll#238)

* fix(popup): Fixed focus events on popup (edcarroll#243)

* feat(datepicker) Popup now honors locale and pickerLocaleOverrides (edcarroll#215)

* Datepicker popup now honors locale and pickerLocaleOverrides

- Datepicker popup items now respect locale format
- Fixed a bug in zoom calendar mapping for datetime datepicker
- Fixed 'es' locale for consistency

(*) Partially addresses edcarroll#164

* Added comments.

* Time of day values supported in locale definitions (edcarroll#214)

* en-GB and en-US locales now use 12 hour format

Original "HH:mm" (23:59) -> Now "hh:mm aa" (11:59 p.m.)

* Fix locales Russian, Italian and Hebrew now extend from ILocaleValues.

* Added new IDatepickerFormatsLocaleValues fields:
- timesOfDay
- timesOfDayUppercase
- timesOfDayLowercase
to support proper formatting/parsing of dates in datepicker.

Updated Localization page

* Fixing code formatting

* feat(datepicker) Added initial date support for the datepicker (edcarroll#216)

* feat(datepicker) New input pickerInitialDate

- New input (optional) that sets the intial date to display (null = today)
- Updated demo page

Partially addresses edcarroll#165

* Now pickerInitialDate only sets CalendarService.currentDate property

* feat(datepicker): Initial date support
- Code formatting

* fix: Various minor bugfixes (edcarroll#245)

* fix(select): Fixed destroyed view errors

* fix(modal): Fix modal auto closing when clicked

* fix(popup): Removed console log in focus handler

* fix(popup): Forced import of TemplateRef

* fix: Fixed AOT on SystemJS builder

Closes edcarroll#209
@earbullet
Copy link

This seems to have popped back up. popper v1.14.1 came out just a few days ago. I've explicitly set it to use the older version to workaround for now: "popper.js": "1.12.9"

ERROR in ../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'.

@FezVrasta
Copy link

1.14.1 does export the namespace 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants