Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

config of new steal

$
0
0
Hi,

stealJS is running itself, but I have some problems with jquery and canJS.

I tried out the StealJS quickstart and it works using a few workarounds form here

Then I downloaded CanJS from here whoch I expected to be the right one working with new steal.

Now I try:

main.js

  1. import $ from "jquery";
  2. steal(
  3.     'myapp/core/init',
  4. function(Init){
  5.     new Init($('body'));
  6. })

where myapp/core/init.js is

  1. steal('can', './init.mustache', function(can, Initview){
  2. return can.Control(
  3.     {
  4.         defaults : {}
  5.     },
  6.     {
  7.       init : function(){       
  8.                 this.element.html(initView({}))
  9.             }
  10. }

and stealconfig.js is

  1. System.config({
  2.     paths: {
  3.         jquery: "bower_components/jquery/dist/jquery.js",
  4.         'jquery/*': "bower_components/jquery/dist/*.js",
  5.         'can/*' : 'bower_components/CanJS/*.js'
  6.     },
  7.     ext: {
  8.         mustache: "can/view/mustache/system.js"
  9.     },
  10.     meta: {jquery: { exports: "jQuery" } }
  11. });

I have two issues with this.

First is that the app tries to load init.mustache.js instead of init.mustache.

Second is, that it throws

  1. Potentially unhandled rejection [2] @https://1.test2/bower_components/steal/steal.js line 4666 > eval:738:3 steal/stealInstantiateResult.execute@https://1.test2/bower_components/steal/steal.js:5299:15 linkDynamicModule@https://1.test2/bower_components/steal/steal.js:3159:1 linkDynamicModule@https://1.test2/bower_components/steal/steal.js:3138:11 linkDynamicModule@https://1.test2/bower_components/steal/steal.js:3138:11 linkDynamicModule@https://1.test2/bower_components/steal/steal.js:3138:11 linkDynamicModule@https://1.test2/bower_components/steal/steal.js:3138:11 linkDynamicModule@https://1.test2/bower_components/steal/steal.js:3138:11 link@https://1.test2/bower_components/steal/steal.js:3035:11 register/loader.instantiate/</<.execute@https://1.test2/bower_components/steal/steal.js:3326:11 link@https://1.test2/bower_components/steal/steal.js:2001:17 doLink@https://1.test2/bower_components/steal/steal.js:1799:9 updateLinkSetOnLoad@https://1.test2/bower_components/steal/steal.js:1843:11 proceedToTranslate/<@https://1.test2/bower_components/steal/steal.js:1681:11 tryCatchReject@https://1.test2/bower_components/steal/steal.js:1083:5 makePromise/FulfilledHandler.prototype.when@https://1.test2/bower_components/steal/steal.js:879:5 makePromise/DeferredHandler.prototype.run@https://1.test2/bower_components/steal/steal.js:729:5 [7]</</</Scheduler.prototype._drain@https://1.test2/bower_components/steal/steal.js:1181:4 Scheduler/this.drain@https://1.test2/bower_components/steal/steal.js:1146:4 run@https://1.test2/bower_components/steal/steal.js:144:5
and when I comment out first line of main.js

  1. //import $ from "jquery";
it throws

error
TypeError: steal.type is not a function


  1. @https://1.test2/bower_components/steal/steal.js line 4666 > eval:738:3 steal/stealInstantiateResult.execute@https://1.test2/bower_components/steal/steal.js:5299:15 linkDynamicModule@https://1.test2/bower_components/steal/steal.js:3159:1 linkDynamicModule@https://1.test2/bower_components/steal/steal.js:3138:11 linkDynamicModule@https://1.test2/bower_components/steal/steal.js:3138:11 linkDynamicModule@https://1.test2/bower_components/steal/steal.js:3138:11 linkDynamicModule@https://1.test2/bower_components/steal/steal.js:3138:11 linkDynamicModule@https://1.test2/bower_components/steal/steal.js:3138:11 linkDynamicModule@https://1.test2/bower_components/steal/steal.js:3138:11 link@https://1.test2/bower_components/steal/steal.js:3035:11 register/loader.instantiate/</<.execute@https://1.test2/bower_components/steal/steal.js:3326:11 link@https://1.test2/bower_components/steal/steal.js:2001:17 doLink@https://1.test2/bower_components/steal/steal.js:1799:9 updateLinkSetOnLoad@https://1.test2/bower_components/steal/steal.js:1843:11 proceedToTranslate/<@https://1.test2/bower_components/steal/steal.js:1681:11 tryCatchReject@https://1.test2/bower_components/steal/steal.js:1083:5 makePromise/FulfilledHandler.prototype.when@https://1.test2/bower_components/steal/steal.js:879:5 makePromise/DeferredHandler.prototype.run@https://1.test2/bower_components/steal/steal.js:729:5 [7]</</</Scheduler.prototype._drain@https://1.test2/bower_components/steal/steal.js:1181:4 Scheduler/this.drain@https://1.test2/bower_components/steal/steal.js:1146:4 run@https://1.test2/bower_components/steal/steal.js:144:5 

when I comment out the paths value
  1. //        'jquery/*': "bower_components/jquery/dist/*.js",
it simply does not find jquery/jquery.js, but it does not throw one of the shown messages.

I have no clou...

Viewing all articles
Browse latest Browse all 3491

Trending Articles