These are chat archives for stealjs/steal

22nd
Feb 2017
Gira Minus
@gKreator
Feb 22 2017 09:26
This is a new one...
blob
When using http://mkoryak.github.io/floatThead/ and steal-build something breaks
ignore the 200 header response, my server is setup to return index.html whenever there is a 404
Gira Minus
@gKreator
Feb 22 2017 10:11
Ok, I guess you just have to shim it.
blob
Not sure exactly why this was the case. It was all working fine in dev mode
Gira Minus
@gKreator
Feb 22 2017 10:19
I guess the shim actually breaks it in dev mode and then not doing a shim works now on both....
Because sometime code is magic
and now its broken... its hit and miss
Gira Minus
@gKreator
Feb 22 2017 10:27
blob
found the magic touch
no idea why this fixes this problem but o well
Sunil George
@georgesunil81
Feb 22 2017 15:09
@matthewp, good morning to you. I developed a mini project that illustrates the issue I am facing at my end. Here are the link to the two versions of it, one using Braintree v3.2 and another using Braintree v3.8.
https://github.com/georgesunil81/Braintree_3_2
https://github.com/georgesunil81/Braintree_3_8
You can clone these, do npm install and run these using a local server at your end. The Braintree_3_2 application should run fine and should show you a form generated by the Braintree library and give a success-message when the form is generated. When you try to do the same with Braintree_3_8, it throws a bunch of 404 and an error that prevents the form generation.
I thank you for all your help in advance.
Matthew Phillips
@matthewp
Feb 22 2017 16:08
cool, thank you
will take a look
Matthew Phillips
@matthewp
Feb 22 2017 16:23
@georgesunil81 use maps instead of paths
    "map": {
      "braintreeClient": "braintree-web/client/index",
      "braintreeHostedFields": "braintree-web/hosted-fields/index"
    },
Sunil George
@georgesunil81
Feb 22 2017 17:02
@matthewp, thank you so much. Thanks a ton.
I will make the change at my end and see if it works for me. Will report back soon.
Sunil George
@georgesunil81
Feb 22 2017 17:27
@matthewp, map is definitely an improvement. I added the map as you showed above, but got couple of 404s.
GET http://127.0.0.1:8080/node_modules/braintree-web/client/request.js?version=1487784259632 404 (Not Found)

Some 404s were encountered while loading. Don't panic! These will only happen in dev and are harmless.

GET http://127.0.0.1:8080/node_modules/braintree-web/lib/bus.js?version=1487784259632 404 (Not Found)

Potentially unhandled rejection [3] ReferenceError: braintree is not defined
    at Constructor.init (http://127.0.0.1:8080/app/pages/braintreeForm/BraintreeFormController.js:21:13)
    at Function.newInstance (http://127.0.0.1:8080/node_modules/can/construct/construct.js:203:15)
    at Constructor.init (http://127.0.0.1:8080/node_modules/can/construct/construct.js:510:30)
    at new Constructor (eval at extend (:483:4), <anonymous>:1:52)
    at http://127.0.0.1:8080/app/pages/app/AppController.js:31:21
    at tryCatchReject (http://127.0.0.1:8080/node_modules/steal/steal.js:1188:30)
    at runContinuation1 (http://127.0.0.1:8080/node_modules/steal/steal.js:1147:4)
    at Fulfilled.when (http://127.0.0.1:8080/node_modules/steal/steal.js:935:4)
    at Pending.run (http://127.0.0.1:8080/node_modules/steal/steal.js:826:13)
    at Scheduler._drain (http://127.0.0.1:8080/node_modules/steal/steal.js:102:19)
    at Scheduler.drain (http://127.0.0.1:8080/node_modules/steal/steal.js:67:9)
    at MutationObserver.run (http://127.0.0.1:8080/node_modules/steal/steal.js:273:4)
I do get the "dont panic" message now. But, the braintree form does not get generated due to the error above.
To try and resolve the two 404s above, I added the following into the map as well, but it did not help!
    "map": {      
      "braintreeClient": "braintree-web/client/index",
      "braintreeHostedFields": "braintree-web/hosted-fields/index",
      "bus": "braintree-web/lib/bus/index",
      "request": "braintree-web/client/request/index"           
    }
Matthew Phillips
@matthewp
Feb 22 2017 17:30
The error is because you are referencing a variable braintree that is not defined
Sunil George
@georgesunil81
Feb 22 2017 17:30
Need more help once you get a chance.
Matthew Phillips
@matthewp
Feb 22 2017 17:30
you need to change your define callback function to reference the client
Sunil George
@georgesunil81
Feb 22 2017 17:32
Yes @matthewp, let me try resolving that now...will post the results...thanks for your help.
Matthew Phillips
@matthewp
Feb 22 2017 17:32
i already tried it, it fixes it :)
Sunil George
@georgesunil81
Feb 22 2017 17:33
Oh, can you share the code once you get a chance.
Please. :)
@matthewp
Matthew Phillips
@matthewp
Feb 22 2017 17:36
there's a patch
git apply controller.patch
Sunil George
@georgesunil81
Feb 22 2017 17:37
Oh ok.
Trying git apply controller.patch at the project root.
Matthew Phillips
@matthewp
Feb 22 2017 17:39
or just look at the file, it's a simple change
Sunil George
@georgesunil81
Feb 22 2017 17:41
Thanks @matthewp, taking a look at it now. I will revert my map to what you had above and then make changes to the controller file.
Sunil George
@georgesunil81
Feb 22 2017 17:56
Hurrah!!! @matthewp . I owe you so many drinks at this point that it is not even funny :)
It worked. Thanks for showing me the changes you made.
I now just have the two pesky 404s with a "dont panic" message inbetween that comforts me greatly :)
GET http://127.0.0.1:8080/node_modules/braintree-web/client/request.js?version=1487786147893 404 (Not Found)

Some 404s were encountered while loading. Don't panic! These will only happen in dev and are harmless.

GET http://127.0.0.1:8080/node_modules/braintree-web/lib/bus.js?version=1487786147893 404 (Not Found)
But, the braintree v3.8 form functionality works for me now.
Thanking you profusely.
Sunil George
@georgesunil81
Feb 22 2017 18:09
@matthewp, I want to upgrade to Steal 1.0 from 0.16. After I upgrade , will I still need cache-bust.js?
Matthew Phillips
@matthewp
Feb 22 2017 18:57
not if you go to 1.2
i'd recommend upgrading to can3 as well
Sunil George
@georgesunil81
Feb 22 2017 19:39
Thanks @matthewp. I will plan with my team on upgrading StealJS and CanJS.
Thanks for all your help.