cstefanache / angular2-img-cropper

Angular 2 Image Cropper
MIT License
364 stars 135 forks source link

Wrong build directory when importing ng2-img-cropper #54

Closed danielserrao closed 7 years ago

danielserrao commented 8 years ago

Hello, I'm having trouble with the importing of the ng2-img-cropper components. I already tried to solve this by changing the systemjs file but without results.

I did the commands "npm i ng2-img-cropper --save" and "npm install"

My systemjs.config.js is the following:

var map = { 'app': 'www/build', // 'dist', .... 'ng2-img-cropper': 'node_modules/ng2-img-cropper' };

var packages = { 'app': {main: 'app.js', defaultExtension: 'js'}, ... 'ng2-img-cropper': { main:'index.js', defaultExtension: 'js'} };

My component is imported like this:

import {ImageCropperComponent } from 'ng2-img-cropper';`

I verified many times the path and I'm sure that is correct. When I import the component, the build is done inside a folder called "app" (wrong) and when I delete the importing, the build is done without the "app" folder (Right), so I'm sure that the problem is on the import.

My angular2 in the package have the version 2.0.0-rc.5. My ng2-img-cropper had the version 0.6.4 when I did the install but I also tried the version 0.6.1 without success.

I also can say that I did the clone of the example in this repository, build and run without any problem but for some reason I can't build it right in my project. I don't know if it is a configuration problem or bug but I hope you can help me on this one.

Thanks for any help.

cstefanache commented 8 years ago

did you checkout the configuration of the plnkr from the readme? https://plnkr.co/edit/V91mKCNkBQZB5QO2MUP4?p=info

danielserrao commented 8 years ago

Yes, I did. I also tried with map "https://npmcdn.com/ng2-img-cropper@0.6.1" without success.

cstefanache commented 8 years ago

What is the error message? Do you get a 404? Are you doing any bundle? Do you use WebPack?

danielserrao commented 8 years ago

Hey.

I don't get any error in compile time but I cant run the app because the build was done inside a folder that wasn't suppose to.Without importing the ImageCropperComponent the the build folder is:

www -> build -> pages -> routes ....

With the importing I have the following:

www -> build -> app -> pages -> routes ....

In this last case, the problem is "Failed to load resource: the server responded with a status of 404 (Not Found)" like you asked. In my systemjs, I configure the path app to be www/build, so, I think is normal to have this error.

Yes, I'm using some bundles, that could be the problem? how?

No, we are not using WebPack.

jurienhamaker commented 7 years ago

Any updates? Has this been fixed by recent updates?

jurienhamaker commented 7 years ago

@danielserrao Will close this in a few days if no reply.

danielserrao commented 7 years ago

Hey, not really, I'm doing other tasks now but I will try to solve this in the next days.

damiansastre commented 7 years ago

this is happening to me too.

cstefanache commented 7 years ago

will do a release 0.7 today - please let me know if you still have the problem after the release

cstefanache commented 7 years ago

Closing the issue - new release 0.7.6 was done today with JS files in the package