ng2-semantic-ui: sui-select: AoT compilation errors

I am using sui-select component along with angular 2.4.x. I am using the AoT compilation to build the components for production using the NGC command. I am getting a number of errors related to Private variables and Syntax mismatch. Attached the error file herewith.

@edcarroll Can you please help. sui-select-error.txt

Inside systemjs

map: {
 'ng2-semantic-ui': 'npm:ng2-semantic-ui',
}
packages: {
 'ng2-semantic-ui': {
        main: 'index.js',
        defaultExtension: 'js'
      }
}

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 21 (10 by maintainers)

Commits related to this issue

Most upvoted comments

I am sorry. I updated it again to 0.6.1 and now its working fine… 😃

did you clone the latest version in a dev environment or install via npm? If cloning, run npm run build, if from npm, make sure you’ve updated the deps in package.json - ^0.5.5 won’t match the latest version (0.6.1)

I believe this issue is now sorted. Update your ng2-semantic-ui to 0.6.1 and then do the following:

  • Remove all individual component references in systemjs.config.js.
  • Change the ng2-semantic-ui line to be: 'ng2-semantic-ui': 'npm:ng2-semantic-ui/bundles/ng2-semantic-ui.umd.min.js'.
  • Remove the reference to element-closest in that same file.
  • Remove <script type="text/javascript" src="./bower_components/semantic/dist/semantic.js"></script> from index.html
  • Add <link rel="stylesheet" href="./bower_components/semantic/dist/semantic.min.css"> to index.html

You should now be able to build it without AoT, and I think the only things blocking the AoT build are some erroneous settings in your config not to do with this library.

Do reopen if you’re still having trouble 😄

I would be happy to share the files 😃 I have uploaded the files to the repository 😃

Oh Sorry. I removed it by mistake. Let me add the AoT scripts to Gulp

I’ve taken a look, and have updated the develop branch with a potential solution - however I don’t yet know if it works for AoT, as your repo doesn’t have that included. Could you please add the failing AoT build to your repo so I can test against it?

Thanks!

@edcarroll Apologies for the delay. here is the link https://github.com/mani0608/mani-ngsemantic.git

I’ve done some investigation and it seems to be an issue with the angular compiler ngc not generating the .ngfactory.ts files with support for generic types. This has been fixed in Angular 4, so I’ve updated the library’s dependencies, and will be publishing a new version on npm tomorrow.