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
Configuring ng2-dragula for system.js seed #89
Comments
Good idea @thomasbee, I will try to post instructions Monday/Tuesday 👍 |
An update on this one: |
Same error, while getting the dragula.directive and dragula.provider. I use the angular template from https://github.com/preboot/angular2-webpack, same you are using. Just |
Good to know consistent error across different loaders... I will update the lib if need be based upon what I find tonight or tomorrow. |
@thomasbee Did you try to use systemJS defaultJSExtension parameter ?
|
@dy0nysos Surely it has something to do with the missing extension, but when I add
to my system.js then the entire angular will no longer load, with many errors like GET http://localhost:3000/angular2/core.js 404 (Not Found) and so on. |
Here is my system.js config that works except for ng2-dragula (I understand eventually I also need to map dragula, but I am not there yet)
|
@thomasbee @yaroslavya And also I fixed the ps: reopen if you still have trouble, however I verified both instructions on both seeds and everything works perfectly. |
I'm not working with any of those seeds (just followed the 5min quickstart) and I'm having the same problems, it's not finding |
@matantsu what seed are you using, and if not using a seed, provide link to your repo or provide details on if using system.js/webpack? Additionally, if you still have trouble, your issue is likely related to the build setup you are using and therefore, is not a bug with the lib itself. |
I did exactly what the 5 min quick-start says (https://angular.io/docs/ts/latest/quickstart.html). I eventually resolved it by:
and importing like: which is problematic because my IDE (webstorm 11) does't recognize it and marks it an awful red. I do not understand how the hell it works but it does ... |
So:
As I mention in the wiki regarding
Then you would use:
System.js config can be complicated to get right. Saying the This is an issue of understanding system.js. |
@NathanWalker Thanks a lot Nathan for the effort, I can confirm that your solution works for me in both seeds. However, much like @matantsu I am also trying to survive without a seed using John Papa's Tour of Heroes project, i.e. https://github.com/johnpapa/angular2-tour-of-heroes I tried adapting my system.js according to your description, i.e. it looks like this now
This results in the following error:
Obviously this relates to the code snippet
I compared the system.js seed and my naked project for hours now, but to no avail. Would you have any idea where this is coming from? Basically, it would be nice to also describe how integrating ng2-dragula would work for John Papa's seed. I would appreciate if you re-open the issue (I cannot) |
@NathanWalker @matantsu
as opposed to the official google example. Not sure I understand why it works now, but at least it does. Thanks a lot to @NathanWalker for the investigation. |
@thomasbee Yes this is a critical detail. Thanks for pointing that out. |
@NathanWalker First of all I appreciate the work you're putting into this library. I have to agree that this library is problematic to install if I compare it to other libraries. If you take for example ng2-uploader (https://github.com/jkuri/ng2-uploader) install instructions, that just works seamlessly. Just include the script in the html OR add mappings to your systemjs config, and it just works. You can import their There is no need to add paths to the systemjs config. You don't have to add mappings. Just adding the script to the html works. I really suggest taking a look at how they pulled that off so more people can integrate ng2-dragula easily. I am saying this as an angular noob. I'm seeing libraries that work seamlessly after just adding a script to the html, and I'm seeing libraries that take a lot of configuration (which makes using multiple tools conflict, for example gulp typescript + tsc + visual studio typescript). Wouldn't it be great if they were all so easy to integrate as ng2-uploader? |
The issue may be that the ng2-dragula.js that I add to the html, is not in a ng2-dragula subfolder (gulp copying it to another folder, not in node_modules)... which makes Because ng2-uploader.js is also not in a ng2-uploader subfolder but that has to be importerted like Although if this is the case, I don't understand why |
I have this problem as well - but with webpack. Trying to add an alias for dragula, but it does not want to work:
I got:
What am I missing? thanks! |
Got it right with the help of: |
Hey @zcsongor I have added the typings for dragula, but still showing cannot find module dragula. Can you guide me what else did you do to install this dragula? Im working with visual studio2015 Steps that I have done:
but still erroring. do I have do add path on index.html? |
@kevinaditya I've added to my SystemJS config as well. |
@zcsongor umm sorry what did you add to systemjs? |
The path, like this (I'm using the angular2-seed btw):
|
By using the configuration '5 Min Quickstart', |
I prefer to stop, unbelievable how complex it is to make it to run, even by following steps to configure it. |
My working settings are: My systemjs.config:
Then import And in @component |
please update the wiki with the instruction above from @ntsekouras |
In my case, finally solved it bij adding this line to system.config.js: After adding "format: 'cjs'" it works fine... |
I am getting this error, SystemJS unexpected token < . It's working fine when I run the project in my local server. When I push it to developement mode, it's throwing that error. SystemJs is not able to load the JS file. Instead it's loading the html file. What could be the solution to solve this issue? |
I fail to figure out how to configure ng2-dragula with the system.js seed https://github.com/mgechev/angular2-seed
I understand there is a similar ticket but clearly describing the solution for this widespread seed would be nice I think.
Versions used:
npm 3.3.12
node v5.1.0
MacOS 10.11.1
Chrome 48
Visual Studio Code Editor
Steps
npm install dragula@3.6.3 ng2-dragula@1.1.0 --save
Then, in a component, when I do
import { Dragula, DragulaService} from 'ng2-dragula/ng2-dragula';
Note the full import path above. Is this correct or incorrect?
I get a runtime error where the browser tries to load dragula.js from
http://localhost:5555/node_modules/dragula.js
where obviously, the directory name is missing.
Questions
I tried such configs in the seed's config.ts file's section DEV_NPM_DEPENDENCIES but didn't find a solution
The text was updated successfully, but these errors were encountered: