Unable to load some can modules


#1

I often don’t understand how steal is supposed to work

I’ve got these two files:
src/Company/Config.js and src/Company/Config/Component.js

Config.js starts with:
define([‘can-stache’, ‘./Config.stache’], function( stache, template ) {

which loads just fine

Component.js start with
define([‘can-control’, ‘…/Config’ ], function( Control, Config ) {

which results in an error-message:
GET http://localhost/configurator/can-control.js 404 (Not found)

Why?? What’s the difference?
Can anyone explain?


#2

Probably you don’t have can-control installed in your package.json dependencies but can-stache is.


#3

Yes, that was it, but then I still don’t understand. Doesn’t can-component itself use can-control? So when I have the higher-level module available, how come I don’t have the lower-level component?


#4

@matthewp can probably give a better answer, but I don’t think Steal will register the dependencies of your dependencies, so you won’t be able to require them unless they’re in your package.json.


#5

That’s right, you can only import dependencies you depend on.