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

Latest version incompatible with Angular CLI #35

Closed
Ismaestro opened this issue Mar 27, 2017 · 12 comments
Closed

Latest version incompatible with Angular CLI #35

Ismaestro opened this issue Mar 27, 2017 · 12 comments

Comments

@Ismaestro
Copy link

Ismaestro commented Mar 27, 2017

I've installed latest version like this:

npm install ngx-clipboard --save

I'm using Angular CLI and there is a problem with v5.0.3 of this module.

I have to use 4.0.0 in my package.json.

Please update de documentation and the module in order to use Webpack and AngularCLI. SystemJS is in decline

@Ismaestro Ismaestro changed the title Version incompatible with Angular CLI Latest version incompatible with Angular CLI Mar 27, 2017
@maxisam
Copy link
Owner

maxisam commented Mar 27, 2017

what version of CLI you are using ? I tested it on angular cli 1.0.0. It works without issue.

@Ismaestro
Copy link
Author

Ismaestro commented Mar 27, 2017

More info:

@angular/cli: 1.0.0-rc.1
node: 7.1.0
os: darwin x64
@angular/cli: 1.0.0-rc.1
@angular/common: 2.4.9
@angular/compiler: 2.4.9
@angular/core: 2.4.9
@angular/forms: 2.4.9
@angular/http: 2.4.9
@angular/platform-browser: 2.4.9
@angular/platform-browser-dynamic: 2.4.9
@angular/router: 3.4.9
@angular/compiler-cli: 2.4.9

In package.json:

"clipboard": "^1.6.1",
"ngx-clipboard": "^5.0.3",

And when I try to do:

import {ClipboardModule} from 'ngx-clipboard';

It says:

ERROR in src/app/shared/shared.module.ts (36,48): Cannot find module 'ngx-clipboard'.)

But if I install "ngx-clipboard": "4.0.0", it works!

@maxisam
Copy link
Owner

maxisam commented Mar 27, 2017

could you try cli 1.0 instead of RC 1?

@JSMike
Copy link
Contributor

JSMike commented Mar 27, 2017

Which version of typescript is included in your project?

@Ismaestro
Copy link
Author

@JSMike My version of typescript is:
"typescript": "~2.0.3"

And @maxisam yes of course I can install cli 1.0 but the thing is that I don't want to work with it. I prefer to work with the release candidate.

The thing here, is why v4.0.0 works and v5.0.2 does not?

Thanks :)

@maxisam
Copy link
Owner

maxisam commented Mar 28, 2017

Ah......Why ? What's wrong with 1.0 ?

Anyway, I think the problem is Typescript version. You can go to your node_module\ngx-clipboard and add "module":"dist/index.js", in package.json and see if it works.

I think this is only different between 4.0 and 5.0.3

@JSMike
Copy link
Contributor

JSMike commented Mar 28, 2017

FYI, Angular 2.x only supports typescript ~2.0.0 so he should he would have to upgrade to the latest typescript 2.0.x, not 2.1.x or 2.2.x

@maxisam
Copy link
Owner

maxisam commented Mar 28, 2017

@JSMike Oh ! I didn't know that. Sorry @Ismaestro you might wanna try manually modify the package.json to see if it works. If it does, I will push another release.

@maxisam
Copy link
Owner

maxisam commented Mar 28, 2017

I think 5.0.8 should take care your issue.

@maxisam maxisam reopened this Mar 28, 2017
@Ismaestro
Copy link
Author

Ismaestro commented Mar 28, 2017

@maxisam That's it. now it works! thanks!

:)

@maxisam
Copy link
Owner

maxisam commented Mar 28, 2017

Cool. It is still kinda weird why it didn't work.

I don't fully understand why removing typings & adding module make this work.

@maxisam maxisam closed this as completed Mar 28, 2017
@Ismaestro
Copy link
Author

I think watching the changes that the problem was the path. In 4.0.0 it was like this:
dist/index.js
and now it has a new folder bundle:
./dist/bundle/ngxClipboard.umd.min.js

So when I tried to import the module typescript didn't find it...

Whatever, now it works, thanks!

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

3 participants