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

AOT build broken #209

Closed
slavik990 opened this issue Aug 3, 2017 · 9 comments · Fixed by #400
Closed

AOT build broken #209

slavik990 opened this issue Aug 3, 2017 · 9 comments · Fixed by #400

Comments

@slavik990
Copy link

slavik990 commented Aug 3, 2017

We updated ng2-semantic-ui version from 0.8.2 to 0.9.4, and after that our AOT build fails:

    Error on fetch for ng2-semantic-ui/dist/modules/transition.js at /node_modules/ng2-semantic-ui/dist/modules/transition.js
	Loading ng2-semantic-ui/dist/modules/dimmer/dimmer.module.js
	Loading dist/tmp/web.module.ngfactory.js
	Loading dist/tmp/main.web.prod.js
	ENOENT: no such file or directory, open ng2-semantic-ui/dist/modules/transition.js'
Details:
    originalErr: Error: ENOENT: no such file or directory, open /node_modules/ng2-semantic-ui/dist/modules/transition.js'
Stack:
Error on fetch for ng2-semantic-ui/dist/modules/transition.js at node_modules/ng2-semantic-ui/dist/modules/transition.js
	Loading ng2-semantic-ui/dist/modules/dimmer/dimmer.module.js
	Loading dist/tmp/web.module.ngfactory.js
	Loading dist/tmp/main.web.prod.js
	Error: ENOENT: no such file or directory, open node_modules/ng2-semantic-ui/dist/modules/transition.js'

It seems problem with file import, when index omitted (like this angular/angular#16152)
I manually added index to transition import path
import { SuiTransitionModule } from "../transition"; => import { SuiTransitionModule } from "../transition/index
it helps, but same problem present in import for other modules

@edcarroll
Copy link
Owner

Ah I see what's happening, the module loader is trying to bundle folders as if they're js files, correct?

What tool are you using to carry out the compilation? I'm testing at the moment with Angular CLI as well as ngc and not seeing this issue.

@slavik990
Copy link
Author

Yes, correct.
We use systemjs-builder. Seems this not supported omit index in path - systemjs/systemjs#1308

@edcarroll
Copy link
Owner

Hmm ok. when using other libraries do you encounter the same issues? To fix this does it just require changing the paths that rely on index automatically to actually specifying index?

@slavik990
Copy link
Author

We use a lot of libraries and for it AOT build works well. And for 0.8.2 version of ng2-semantic-ui it also works.
Yes - just adding missing index in path fix this error.

@edcarroll
Copy link
Owner

Ok 2 things:

Firstly, I've made a PR that I think addresses this. Could you download the attachment, and copy the contents over your current ng2-semantic-ui in node_modules please? It should let you build now as all the /index things have been added (I hope).

Secondly, I've been wanting to move the library to use custom tsconfig paths rather than mega relative things. This will look like import { Util } from "@sui/util"; or something along those lines. Typescript doesn't convert these paths when compiling, it just leaves them as is, so would this change be something that a) breaks your build system and b) something that you can map manually?

Once this is sorted it will go out in 0.9.5.

build.zip

@slavik990
Copy link
Author

  1. Build works great, but something with modal vertical position(is it present for you? If no, I'll investigate it)
  2. I checked but not find any information about supporting tsconfig paths for 'systemjs-builder', but if you want you can create simple build with few new tsconfig paths imports and I will check it.

@edcarroll
Copy link
Owner

  1. Not seeing the issue myself, are you able to reproduce it in the test page? I can then try it out myself manually.
  2. Not to worry - for now I'm going to leave as is and potentially will update things in v0.10.0. Will ping you if I do change it so you can test 😄

mcosta74 pushed a commit that referenced this issue Aug 14, 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
@edcarroll
Copy link
Owner

This is now live in 0.9.5. Let me know if you have any further issues 😄

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
@bargoldi
Copy link

Hi @edcarroll ,
Looks like you really found the issue, but it seems like not everything got fixed yet.
e.g: sui.module.js tried to import from collections.js (needs to be collections/index.js). There are a few more of those.

@edcarroll edcarroll reopened this Sep 21, 2017
@edcarroll edcarroll removed this from the 0.9.5 milestone Mar 16, 2018
edcarroll added a commit that referenced this issue Aug 2, 2018
@edcarroll edcarroll added this to the 0.10.0 milestone Aug 2, 2018
edcarroll added a commit that referenced this issue Aug 2, 2018
* fix: Fixed AOT when imported as library

Fixes #209

* fix(demo): Fixed SuiPopupConfig injector error

* refactor: Renamed all `index` files to `internal`

This will ensure that no imports are accidentally created using just the directory name, which causes endless problems with Angular's CLI

* fix(demo): Fixed stack overflow in compilation
anoophm added a commit to project-sunbird/ng2-semantic-ui that referenced this issue Mar 25, 2019
* chore: Update to Angular 6 (edcarroll#398)

* chore: Moved to newest Angular CLI

* fix: Fixed rxjs references

* chore: Deleted migration folder

* style: Fixed tslint errors in test

* fix: Updated all class HostBindings to be public

* fix: Updated all HostListener bindings to be public

* fix(collapse): Fixed HostBinding modifiers

* fix(collapse): Fixed isCollapsed HostBinding

* fix: Updated remaining HostBindings to be public

* feat: Made all hasClasses properties readonly

* revert: "feat: Made all hasClasses properties readonly"

This reverts commit 2f78b5c.

* feat: Updated getter only properties to use readonly modifier

* fix(demo): Fixed ApiDefinition typings

* fix(localization): Fixed compilation of locales

* chore: Moved some deps from peer to normal

* fix: Added library dependencies to whitelist

* test: Fixed all tests

* style(demo): Fixed polyfill lint errors

* test: Updated Travis to use NPMv6

* test: Removed superfluous lint from Travis config

* chore: Fixed loop in package scripts

* test: Reverted to npm@5 for Travis

* chore: Added conf.js ignore to gitignore

* fix: AOT Compilation in Angular 6 & SystemJS (edcarroll#400)

* fix: Fixed AOT when imported as library

Fixes edcarroll#209

* fix(demo): Fixed SuiPopupConfig injector error

* refactor: Renamed all `index` files to `internal`

This will ensure that no imports are accidentally created using just the directory name, which causes endless problems with Angular's CLI

* fix(demo): Fixed stack overflow in compilation

* fix: Performance issues due to document listeners (edcarroll#399) (Closes edcarroll#284)

* Fix issue with slow typeaheads

* Remove check for contains since listener is now on native element

* feat(search): Remove reliance on document event

* fix(popup): Fixed performance issues due to excessive document listeners

* fix(popup): Fixed missing nullcheck

* feat(select): Removed reliance on separate keydown listener

* chore(demo): Updated environment config to match latest angular

* feat(demo): Removed dev environment file

* feat(dropdown): Fully removed document listener

* fix: Broken merge

* fix(dropdown): Parent element accessed before initialisation (edcarroll#401)

* fix(dropdown): Fixed parentElement being accessed before initialisation

* chore: Bumped version

* fix: Keyboard navigation in select component (edcarroll#402)

* fix(dropdown): Parent element accessed before initialisation (edcarroll#408)

* fix(dropdown): Fixed parentElement being accessed before initialisation

* chore: Bumped version

* fix(dropdown): Dropdown menu isOpen of undefined (edcarroll#380)

* fix(select): Fixed nested labelField and valueField error (edcarroll#405) (Closes edcarroll#381)

* feat(popup): Added `isFlowing` and `isInline` properties (edcarroll#385)

* feat(popup): Added arrow centering, size and width properties (edcarroll#350)

* feat(popup): Added size and width properties

* feat(popup): Added arrow centering on small popup anchors

* fix(popup): Corrected popup positioning, removed double popper update

* fix(popup): Added timeout for positioning service create

* fix(modal): Fixed modal positioning for SUI v2.3 (edcarroll#362) (Closes edcarroll#371)

* fix(dimmer): Fixed dimmer to work correctly with SUI v2.3.0

* fix(modal): Fixed modal positioning for SUI v2.3.0

* chore: Updated SUI version to 2.3.1

* chore: Fixed typescript dependency version

* feat(modal): Added isCentered property

* doc(modal): Updated API description

* docs(modal): Fixed a typo in a property description

* fix(modal): Fixed barrel reference & private `HostBinding`

* docs: Updated Angular and Semantic UI versions

* chore: Bumped alpha version

* fix: Removed private label from package json

* chore: Added prepublishOnly script to ensure final compilation before publish

* chore: Bumped alpha version

* Issue #SB-10187 fix: updating angular version

* Issue #SB-10187 fix: updating angular version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants