Skip to content

Importing issue #19

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

Closed
FallenRiteMonk opened this issue Dec 12, 2016 · 8 comments
Closed

Importing issue #19

FallenRiteMonk opened this issue Dec 12, 2016 · 8 comments

Comments

@FallenRiteMonk
Copy link
Contributor

I'm using angular-cli for my project and never had a problem importing this library:

...
import { AngularOpenlayersModule } from 'angular2-openlayers';
...
@NgModule({
  imports: [
    ...,
    AngularOpenlayersModule
]
...

but since angular-cli beta 22 it no longer works. I get the following error:

Error: Unexpected value 'AngularOpenlayersModule' imported by the module '<MODULE_NAME>'

I don't know exactly if this is a problem with angular-cli or with this library, so please have a look at it or let me know if you have no time/idea, then I'll create a issue at the angular-cli repo.

@quentin-ol
Copy link
Collaborator

Sorry, I'm kinda swamped today. I will look into this tomorrow.

So, if I understand well (otherwise correct me):

  • this issue is due the lack of AOT support in angular2-openlayers.
  • angular-cli beta 22 adopted AOT and broke the import (wild guess there).
  • you're workin on a PR to make angular2-openlayers AOT-compliant (friendly ?)

Thanks again, your help is much appreciated !

@FallenRiteMonk
Copy link
Contributor Author

You are correct in all 3 points, with the little extra to say that beta 22 didn't adopt AOT but made it default (on purpose or not) angular/angular-cli#3368.

Still I think it is important to generally be AOT compliant and also angular-cli complient, since I thing/guess the cli will be the future default boilerplate for angular2 apps and AOT because I'd rater decline this library then AOT since it gave me a extreme performance boost on one of my apps (Loading time form 10sec to 2sec, with no other changes then just compiling using AOT)

@quentin-ol
Copy link
Collaborator

I believe this issue is solved, could you double-check and close it ?

@FallenRiteMonk
Copy link
Contributor Author

Sorry I was on the road for a few days, so I couldn't test. I saw you merged everything so I tried importing version 0.4.1 from npm and tried running it with aot, but the map stayed blank.

I don't know exactly what the problem now is, but I'll have a look and let you know. In the mean while could you please tell me exactly what procedure you run in order to publish on npm.

@quentin-ol
Copy link
Collaborator

I'm using the npm publish command.
The complete workflow is given here: https://docs.npmjs.com/getting-started/publishing-npm-packages

@FallenRiteMonk FallenRiteMonk mentioned this issue Dec 19, 2016
@FallenRiteMonk
Copy link
Contributor Author

Do you have to run npm run prepublish befror npm publish or is that automatically done like with npm pack?

@quentin-ol
Copy link
Collaborator

Hey!
No need to run prepublish prior to npm publish as it takes care of it. Here is the output of npm publish:

$[edited...]npm publish

> [email protected] prepublish /[edited...]/angular2-openlayers
> ngc

+ [email protected]

@quentin-ol
Copy link
Collaborator

Closing as angular2-openlayers is now AOT compliant.
Feel free to reopen if need be

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

No branches or pull requests

2 participants