These are chat archives for canjs/canjs

29th
Jan 2018
cedricalfonsi
@cedricalfonsi
Jan 29 2018 15:51

Hey guys & girls, currently migrating from 2.3 to 3.12, and I just got a weird issue :

You can't have two versions of can-cid, check your dependencies

If someone has an idea about this, it would be great.

Kevin Phillips
@phillipskevin
Jan 29 2018 16:09
you can run npm ls can-cid and see why you have two different versions
cedricalfonsi
@cedricalfonsi
Jan 29 2018 16:11
Thanks for the advice
Hmm the same version is in use everywhere 1.1.2
cedricalfonsi
@cedricalfonsi
Jan 29 2018 16:36

Probably relative to this

This happens when module identifiers normalize to different module names.

Kevin Phillips
@phillipskevin
Jan 29 2018 16:37
I've never seen this happen when there really is only one version
Frank Lemanschik
@frank-dspeed
Jan 29 2018 16:38
@cedricalfonsi are we talking about nested projects maybe?
you need to know as long as there is a chain of node_modules folders
they get all walked up
Kevin Phillips
@phillipskevin
Jan 29 2018 16:39
npm ls should show this
Frank Lemanschik
@frank-dspeed
Jan 29 2018 16:39
kevin nope!
it will not list that
project = js project
project1 -> project 2
Kevin Phillips
@phillipskevin
Jan 29 2018 16:40
$ npm ls can-cid
can@4.0.0-pre.13 /Users/kevin/dev/canjs
├─┬ can-define@2.0.0-pre.33 -> /Users/kevin/dev/can-define
│ └─┬ can-util@3.11.1
│   ├── can-cid@1.1.2
│   ├─┬ can-dom-data-state@0.2.0
│   │ └── can-cid@1.1.2  deduped
│   ├─┬ can-event-dom-enter@1.0.4
│   │ └── can-cid@1.1.2  deduped
│   └─┬ can-event-dom-radiochange@1.0.5
│     └── can-cid@1.1.2  deduped
├─┬ can-kefir@1.0.0-pre.3
│ └─┬ can-event@3.7.6
│   └── can-cid@1.1.2  deduped
├─┬ can-list@4.0.0-pre.10
│ └── can-cid@1.1.2
├─┬ can-map@4.0.0-pre.12
│ └── can-cid@1.1.2  deduped
├─┬ can-util@3.11.1
│ ├── can-cid@1.1.2  deduped
│ ├─┬ can-dom-data-state@0.2.0
│ │ └── can-cid@1.1.2  deduped
│ ├─┬ can-event-dom-enter@1.0.4
│ │ └── can-cid@1.1.2  deduped
│ └─┬ can-event-dom-radiochange@1.0.5
│   └── can-cid@1.1.2  deduped
└─┬ can-view-scope@4.0.0-pre.49
  └── can-cid@1.1.2  deduped
Frank Lemanschik
@frank-dspeed
Jan 29 2018 16:40
cd project 2
aww
Kevin Phillips
@phillipskevin
Jan 29 2018 16:40
it definitely does...
Frank Lemanschik
@frank-dspeed
Jan 29 2018 16:41
your braeaking my buity example
project1 -> project 2
cd project2
npm ls in project2 will not show project1
you can test that
go for example into a feathers canjs app
or bitballs
go into public
do npm ls
cedricalfonsi
@cedricalfonsi
Jan 29 2018 16:42
@phillipskevin Yeah I see something like this
@frank-dspeed I'm not in nested projects right now (but it will come soon)
I guess it's related to my stealconfig.js and the section paths that I used to solve the relative path issue I had
Frank Lemanschik
@frank-dspeed
Jan 29 2018 16:42
but nodejs will walk that up
i am nodejs senior user from the beginning i know what it does
Kevin Phillips
@phillipskevin
Jan 29 2018 16:43
what version of steal are you using @cedricalfonsi ?
cedricalfonsi
@cedricalfonsi
Jan 29 2018 16:43
1.6.4 but I had the error with 1.6.2
Frank Lemanschik
@frank-dspeed
Jan 29 2018 16:43
@cedricalfonsi did you install via yarn?
Kevin Phillips
@phillipskevin
Jan 29 2018 16:43
do you need a stealconfig?
cedricalfonsi
@cedricalfonsi
Jan 29 2018 16:43
@frank-dspeed no
Kevin Phillips
@phillipskevin
Jan 29 2018 16:43
maybe get rid of it?
cedricalfonsi
@cedricalfonsi
Jan 29 2018 16:44
Yeah I guess, I need it, otherwise steal is not able to find my dependencies, but maybe I'm not using it the way I should
steal.config({
    map: {
        "jquery/jquery": "jquery"
    },
    paths: {
        "jquery": "node_modules/jquery/dist/jquery.js",
        "steal": "node_modules/steal/steal.js",
        "mocha": "node_modules/mocha/mocha.js",
        "mocha/mocha.css": "node_modules/mocha/mocha.css",
        "chai": "node_modules/chai/chai.js",
        "chai-jq": "node_modules/chai-jq/chai-jq.js",
        "xregexp": "node_modules/xregexp/xregexp-all.js",
        "can": "node_modules/can/can.js",
        "can/*": "node_modules/can/*.js",
        "can-assign": "node_modules/can-assign/can-assign.js",
        "can-cid": "node_modules/can-cid/can-cid.js",
        "can-cid/*": "node_modules/can-cid/*.js",
        ... The spirit is here
        "proto-compute": "node_modules/can-compute/proto-compute.js",
        "reflections/*": "node_modules/can-reflect/reflections/*.js",
        "types/map": "node_modules/can-reflect/types/map.js",
        "types/set": "node_modules/can-reflect/types/set.js"
    },
    meta: {
        "mocha": {
            "format": "global",
            "exports": "mocha",
            "deps": [
                "test/lib/stealMochaAddDom"
            ]
        }
    },
    ext: {
        "ejs": "lib/can/viewEjsSystem"
    }
});
System.config({
    buildConfig: {
        map: {
            "can/util/util": "node_modules/can/util/domless/domless"
        }
    }
});
Had to add the relfection/*, types/map to solve relative path issues
Frank Lemanschik
@frank-dspeed
Jan 29 2018 16:47
wow
a whole systemjs config
:D
@cedricalfonsi if you need help with that syntax look into systemjs docs
path is overwriting even map
cedricalfonsi
@cedricalfonsi
Jan 29 2018 16:48
Yeah, sorry to pollute the channel
Frank Lemanschik
@frank-dspeed
Jan 29 2018 16:49
you do have a really strange config
normal path is a anti pattern
you should move your path stuff to map
path is a after hook for manipulating the final module name
cedricalfonsi
@cedricalfonsi
Jan 29 2018 16:52
That what I had in mind, thanks for the advice, I'm refactoring that little dirty code I wrote ;)
Frank Lemanschik
@frank-dspeed
Jan 29 2018 16:52
try copy to map
that could solve it or use current steal
and don't do map and path
it will then use the systemjs npm extension
you can see current steal as systemjs + autoconfig
Brad Momberger
@bmomberger-bitovi
Jan 29 2018 16:55
remove ".js" from the end when moving from paths to map
cedricalfonsi
@cedricalfonsi
Jan 29 2018 16:56
(I assume that I didn't mention I'm using steal in a browser, for that you can throw me stones of any size)
Frank Lemanschik
@frank-dspeed
Jan 29 2018 16:57
using it in the browser is total ok
it autoconfigs also in the browser
you need to point main="/js/package.json!npm"
it will then work while js === your app
cedricalfonsi
@cedricalfonsi
Jan 29 2018 16:59
ok I give it a try
cedricalfonsi
@cedricalfonsi
Jan 29 2018 17:06
thanks for the advices guys, it's very appreciated, I'm going back to the basic and I will cut some fat
Frank Lemanschik
@frank-dspeed
Jan 29 2018 17:30
@cedricalfonsi on the stealjs homepage are new guides
check them out they are good writen
they help a lot
Gregg Roemhildt
@roemhildtg
Jan 29 2018 19:55
Got a weird issue in can-zone/lib/tasks. Wondering if anyone can point me in the right direction:
exports.removeEventListener = function(removeEventListener, Zone){
    return function(eventName, handler, useCapture){
        var outHandler = handler[EVENT_HANDLER] || handler; // <---------------Error here becuase handler is Undefined
        return removeEventListener.call(this, eventName, outHandler, useCapture);
    };
};
Looking up the stack trace, it looks like add-event-compat is trying to remove a can-slot element
Gregg Roemhildt
@roemhildtg
Jan 29 2018 20:03
with a workaround...basically changing handler = {} I can see there's actually dozens of these issue popping up...
Frank Lemanschik
@frank-dspeed
Jan 29 2018 21:10
this tells me nothing
why do you think its a package conflict
?
Gregg Roemhildt
@roemhildtg
Jan 29 2018 21:11
I just don't know where to start. I have had a lot of issues with package conflicts in the past....install a new package stuff breaks so that's my go to usually if I don't know whats wrong
Frank Lemanschik
@frank-dspeed
Jan 29 2018 21:11
ah don't worry
wait some hours
they are releasing can4 at present
Gregg Roemhildt
@roemhildtg
Jan 29 2018 21:12
Ah
Nice
Frank Lemanschik
@frank-dspeed
Jan 29 2018 21:13
can-connect           2.0.0-pre.17  2.0.0-pre.17  1.5.17  applications
can-connect-feathers   4.0.0-pre.2   4.0.0-pre.2   3.7.1  applications
can-define-backup      1.0.0-pre.1   1.0.0-pre.1   0.0.1  applications
can-util                    3.11.2           git     git  applications
done-autorender        2.0.0-pre.8   2.0.0-pre.8   1.5.2  applications
done-component         2.0.0-pre.1   2.0.0-pre.1   1.0.1  applications
done-serve             2.0.0-pre.0   2.0.0-pre.0   1.5.0  applications
this is whats left open
they need to merge my can-util PR
and the can and done versions need to get renamed to 4.0.0 and 2.0.0
maybe you get then better error messages
at last me it helped a lot
Gregg Roemhildt
@roemhildtg
Jan 29 2018 21:17
Yeah, I've been looking forward to the better loggin/queues stuff!
Frank Lemanschik
@frank-dspeed
Jan 29 2018 21:21
haahhaha
i tought the same
i don't got this can-queue log stuff working
but i got better debug messages
also i don't got this autorender-brake point working
but i got finaly insights into done-ssr done-serve done-ssr-middleware
and coded my own version that debugs a bit more
done-ssr produces a stream to know what it does you need to inject into that was really complicated
Gregg Roemhildt
@roemhildtg
Jan 29 2018 21:26
Yeah, I've tried playing around with the ssr function...and didn't really know what to do with it. I'm not really familiar with streams
Frank Lemanschik
@frank-dspeed
Jan 29 2018 21:37
ya it was complex :)
the stream is a result of the babel transpile
from steal
steal(systemjs)=> babel => stream === done-ssr
then done-autorender is a systemjs plugin
the systemjs-npm plugin reads the package.json finds the call for a main with done-autorender executes and exports that
and some how i don't know why is browserify stuff in that
i think that used for some extra stuff that i don't saw