KFNEXUS / KFNEXUS.github.io

GNU Lesser General Public License v3.0
3 stars 6 forks source link

Some are experiencing issues. #33

Closed CrazyVulcan closed 7 years ago

CrazyVulcan commented 7 years ago

jsterner73 kfnexus

Some are experiencing errors when trying to open Utopia. It seems mostly confined to computers that have not loaded it in awhile like my desktop and others who have reported the issue on Facebook. The error log points to angular.js Line 13236 Col 24 and I have not a clue to what it means by "TypeError: Cannot read property 'search' of undefined" But researching this it says that it is an error with the json but I just checked it and there is no such issue. Also the Set-Viwer is working just fine so I know its not the json file.

I believe the actual issue is in the min.js file as that is the only one that has been edited recently However the site works just fine on my Laptop and others says the site works for them. I will keep researching and looking into it but I am stumped to what I need to do.

Sorry to dump this on you -Christopher

jsterner73 commented 7 years ago

If I understand this right, you edited the .min.js files? They should not be touched and these are created by the GRUNT command. The files you should edit are located in the src folder, files in the staw-utopia folder are generated by GRUNT (see my Wiki description on this topic).

CrazyVulcan commented 7 years ago

@jsterner73 OK, I am very much an idiot and am well aware of the fact that I don't know what I am doing 90% of the time. I have spent the last 6 or so hours learning as much as I can digest on node.js I have managed to install it but have no clue how that grunt thing works. I however have been able to follow along with the tutorials and gotten Node.js working in my command prompt on my pc. I however have no clue as to how to get the 'grunt' command to actually works with GIT. I managed to use the command prompt to find and correct errors in the file for the card rules in the src. Which is the only file I have touched but when I Grunt I get this error

`\C:\Utopia>grunt

Local Npm module "grunt-utopia-data" not found. Is it installed?

Running "ngtemplates:utopia" (ngtemplates) task File staw-utopia/utopia-templates.js created.

Running "uglify:js" (uglify) task

1 sourcemap created. 1 file created.

Running "cssmin:css" (cssmin) task

1 file created. 26.05 kB → 20.74 kB

Running "copy:css" (copy) task Copied 1 file

Running "copy:index" (copy) task Copied 2 files Warning: Task "utopia_data" not found. Use --force to continue. `

No clue to what utopia_data is referring to as I have never seen that file. Is it actually the data.json? Again I will apologize as I have no schooling or experience with web coding prior to Utopia and I am learning as I go along. Though honestly at times its like digging a tunnel with no other means then repeatedly banging one's forehead against the rock face to excavate a path.

jsterner73 commented 7 years ago

@CrazyVulcan I understand your frustration and believe me I also had to find this out myself, since the original coder was not available for helping me finding out the things I wrote on the wiki. I added a passage for the grunt-utopia-data plugin-package and I hope this is working (I can't easily test it since my machine is already correctly configured).

In any case, you really need this to get working, because if you edit stuff in different files in the src and staw-utopia folders, the next time someone uses GRUNT to generate those files the way it should be done, your changes in staw-utopia will be overwritten.

Also, you edited and added rules in the src\js\common\utopia-card-rules.js file correct? How did you test your changes, if you didn't generate the output file with GRUNT?

But anyway, thanks for taking the time to try and learn the stuff to make this site better. But if anything - especially the wiki instructions which I wrote exactely for other people editing stuff on the site to not run into the same problems I had - is unclean just ask, even if the whole wiki entry is unclean, so I will rewrite it so that it actually is helping and not confusing people.

CrazyVulcan commented 7 years ago

@jsterner73 Thanks, I will look at it in the morning, and I understand that I need to work in the src folder. I will do so from now on. As to how I got it working, I have a copied repository on crazyvulcan.github.io that I use to test all my changes in before I push them though. And have been just editing the hot code into the min.js file directly. Funny enough even though a lot of the words are subbed out I still was able to read it after running the file through a js beautifier I found online. I may not be very smart but I am at least clever and resourceful lol.

And so with all that I had been managing to circumvent the src folder and this grunting. Until yesterday I literally had no idea what node.js was. And reading the wiki and the GRUNT webpage on setting up was not very clear for someone with my level of understanding.

Such things like, where do I download a working copy of grunt. The web page https://gruntjs.com/installing-grunt kept taking me in circles without a clear step 1 step 2 etc. It used a lot of terminology and shorthand I am unfamiliar with. Such as what do they mean by the console. The one in my web browser? my Windows OS command prompt. One I install and if so where to get and install too?

I am a strange man, and I never understood why I am like this but I am really great with ideas and advanced concepts but am missing a lot of the basics. Most people learn by mastering the basics and moving up but I seem to gravitate to the other end. And basically, learn the advanced so I get the basics vicariously as I go along. Naturally finding resources from this perspective is difficult.

Everything I have learned in programming, with Utopia mostly and some other side projects, had been though looking at what is already there and Frankinstineing it together from there.

Like I said I will look at the wiki again in the morning. And I am in the prosses of redoing my work in the utopia-card-rules.js file. Should be done in a few days.

Night, Christopher

CrazyVulcan commented 7 years ago

@jsterner73 OK, what am I doing wrong? I installed the grunt CLI correctly I think and it grunts ok save for the end where it is looking for a "grunt-utopia-data" and "utopia_data". Do you know what I am doing wrong?

https://i.imgur.com/joYTJwK.png

jsterner73 commented 7 years ago

@CrazyVulcan ok, you need to install grunt-utopia-data - I have attached my local copy of the folder (can also be found on GitHub, see Wiki) and you need to install it from there (npm install grunt-utopia-data --save-dev where grunt-utopia-data is the folder you extracted the zip file to). I also corrected the rules file, because I got errors when running grunt on my machine, so you should be good to go and use grunt

grunt-utopia-data.zip

CrazyVulcan commented 7 years ago

@jsterner73 I GOT IT WORKING!!! At least locally on my machine. Now how do I do it on GitHub? And how do I know it worked?

jsterner73 commented 7 years ago

I'm not sure I understand the question. Everything you've done to make grunt work is not included in the GitHub repository. All your changes have to be done in the src folder and then - using the grunt command/tool - the changes are also made in the other folder, the one that the web page is publishing.

CrazyVulcan commented 7 years ago

@jsterner73 OK I don't know if I am communicating how very basic low level this question is. I have Node.JS installed on my PC in my C:\ Directory. I open and use it with the "Node.JS command prompt" with admin privileges. I downloaded your zip folder and installed it inside C:\Users\ME\Utopia\node_modules in a folder called "grunt-utopia-data"

Then back in the command prompt I ran the "npm install grunt" inside my command prompt and after it installed I typed in "grunt" and it ran giving back no errors and giving me this message https://i.imgur.com/kmMbBUH.png "Done without Errors". But I have no idea what it actually did or where it did it. I am assuming, giving how the files inside C:\Users\ME\Utopia\staw-utopia have been changed and uglified that everything is working.

BUT I don't know how I am supposed to affect the files inside kfnexus.github.io with it. All it does is update the files locally in my C Drive. I have looked over the Wiki and the gruntjs.com page several times and have yet to see what I am doing wrong plainly spelled out for me. Is the extension in Chrome I still need? is there a switch/page/command on github.com I am overlooking? Do I do this in the console in the dev tools with F12?

I am sorry if I am not explaining it correctly but I seem to be missing something of a very fundamental level that you think I should know already and are skipping.

I don't suppose you could send me a screenshot of where you are doing the grunting from/with/to/at

CrazyVulcan commented 7 years ago

@jsterner73 OK so it turns out that there is a GitHub desktop application. I just pushed an update. Broke it, then reset it.....I would call that progress but I am feeling much better now

jsterner73 commented 7 years ago

@CrazyVulcan how do you usually upload changes to the git repository to GitHub? If the folder you are doing your grunt command in are not the ones sychronized with git there will be no way to upload the changes. If it is the same folder you use to do your manual updates in, there should be differences in files after you did the grunt command. The messages your grunt command writes look good, so I think you are on the right track.

Don't forget though that the changes you only did in the destination folder - like staw-utopia\data\data.json will be overwritten by the grunt command and you should apply those changes to the files in the src folder before that.

CrazyVulcan commented 7 years ago

@jsterner73 OK as you can see I have successfully updated the site with the fed helmsman comment. So now that I know more of what I am doing we can move to the actual issue for those not being able to see the site. Do note that the Set Viewer is working fine it's just the builder. Here is what the consul is showing on crome.

angular.js:13236 TypeError: Cannot read property 'search' of undefined at String. (utopia.min.js:1) at Function.each (jquery.js:360) at utopia.min.js:1 at Function.map (jquery.js:447) at utopia.min.js:1 at fn (eval at compile (angular.js:14086), :4:377) at regularInterceptedExpression (angular.js:15213) at Scope.$digest (angular.js:16655) at Scope.$apply (angular.js:16928) at done (angular.js:11266) (anonymous) @ angular.js:13236 /favicon.ico Failed to load resource: the server responded with a status of 404 (Not Found)

EDIT> Just found a interesting work around. If you select "Temporarily Show All Cards" in the checked expansions tab it works until you reopen the page then you have to do it again

jsterner73 commented 7 years ago

Hi, I think I found the error in your file.

First of all, you should always try the thing locally on your machine. As you are using Google Chrome as well, there's a secret parameter to do so: how to launch javascript locally in chrome

With that settled, open the html files in the staw-utopia folder and it should display the same thing as on GitHub.

Anyway, to the current error, there's a set reference in the the two new versions of the core ships, but it's not introduced in the sets section of the data.json file:

        "type": "set",
        "id": "22303p",
        "name": "Core",
        "releaseDate": "2017-10-30",
        "parentSet": "2017 Starter Set"

should read

        "type": "set",
        "id": "2017core",
        "name": "Core",
        "releaseDate": "2017-10-30",
        "parentSet": "2017 Starter Set"

and then it's working on my machine at least. Please try this and if it's working for you as well commit this change to GitHub.

CrazyVulcan commented 7 years ago

@jsterner73 yep that did the trick, and Joerg thank you so much for your patience and help.