These are chat archives for canjs/canjs

27th
Jun 2017
Gregg Roemhildt
@roemhildtg
Jun 27 2017 12:19
@phillipskevin yep, that's the error I'm getting, but with a promise instead of a canMap.
image.png
@justinbmeyer that code was from the can-define/define-helpers
Frank Lemanschik
@frank-dspeed
Jun 27 2017 13:06
@roemhildtg easy fix npm install can-define@1.2.1
you probally got can-define@1.2 you can check that via npm ls can-define
if you got anywhere 1.20
you need to delete it or even better delete node_modules and do fresh npm install
Gregg Roemhildt
@roemhildtg
Jun 27 2017 13:07
Actually according to npm ls I'm at 1.2.3
Frank Lemanschik
@frank-dspeed
Jun 27 2017 13:07
and you get the error you posted?
Gregg Roemhildt
@roemhildtg
Jun 27 2017 13:07
Yup, I have removed node-modules and reinstalled just to be safe
The simplest failing example:
image.png
Frank Lemanschik
@frank-dspeed
Jun 27 2017 13:10
please do that
this is a branch where this should be corrected
its not published but you can verify it its working :)
Gregg Roemhildt
@roemhildtg
Jun 27 2017 13:10
ok
Kevin Phillips
@phillipskevin
Jun 27 2017 13:11
that issue is not fixed in can-define
Frank Lemanschik
@frank-dspeed
Jun 27 2017 13:12
but you did a pull
Kevin Phillips
@phillipskevin
Jun 27 2017 13:12
that PR isn't going to be merged, so don't use that branch
Frank Lemanschik
@frank-dspeed
Jun 27 2017 13:12
i tought this is the fix?
ok
Kevin Phillips
@phillipskevin
Jun 27 2017 13:12
Justin is working on a broader fix
Frank Lemanschik
@frank-dspeed
Jun 27 2017 13:12
but is that one you did working so he can develop a bit?
ah any way
i have a better idea
npm install can-define@1.2.1
as this is working
or hmmm maybe there the fail is also as its about map in map
but the last 1.0.xx should work
Gregg Roemhildt
@roemhildtg
Jun 27 2017 13:15
That branch did fix that issue. Now I'm getting an infinite loop of GET requests...
:smile:
Frank Lemanschik
@frank-dspeed
Jun 27 2017 13:16
don't sounds so good right :)
maybe you should consider installing @^1.0.1
i did that as the can reflect update happend
it worked for 1 day for me maybe that gets u up and running till 1.2 is fixed
Gregg Roemhildt
@roemhildtg
Jun 27 2017 13:19
We're up and running on production, just throwing these issues up on dev right now so its not super urgent
Frank Lemanschik
@frank-dspeed
Jun 27 2017 13:22
ah perfecto
thanks kevin for the hot fix ;)
Kevin Phillips
@phillipskevin
Jun 27 2017 13:47
you can always use the versions from canjs master
Frank Lemanschik
@frank-dspeed
Jun 27 2017 13:49
but there the fix is not merged it
in
he is now using your map-in-map branch
Kevin Phillips
@phillipskevin
Jun 27 2017 13:58
the issue doesn't exist in canjs master
those versions have not been updated with the can-reflect changes that caused the issue
Frank Lemanschik
@frank-dspeed
Jun 27 2017 13:59
ah when you say canjs master
your talking about canjs/canjs right?
the meta repo with all packages not the single packeges
because in can-define master is the last published npm version and that has the issue
Kevin Phillips
@phillipskevin
Jun 27 2017 14:00
right
canjs/canjs
Frank Lemanschik
@frank-dspeed
Jun 27 2017 14:00
but he then would need to rewrite code
Kevin Phillips
@phillipskevin
Jun 27 2017 14:00
why?
Frank Lemanschik
@frank-dspeed
Jun 27 2017 14:01
or install the same versions
as in package json yes
hmmm
Kevin Phillips
@phillipskevin
Jun 27 2017 14:01
if he's not blocked by the issue, that's fine
Frank Lemanschik
@frank-dspeed
Jun 27 2017 14:01
i am wondering wouldn't it be a cool tool to read package.json from canjs/canjs
Kevin Phillips
@phillipskevin
Jun 27 2017 14:01
we'll get a fix out
Frank Lemanschik
@frank-dspeed
Jun 27 2017 14:01
and install and pin that versions
in a donejs project
so we could upgrade canjs in a donejs project
Kevin Phillips
@phillipskevin
Jun 27 2017 14:02
yeah, that would be cool
Frank Lemanschik
@frank-dspeed
Jun 27 2017 14:02
ok cool i will write that
as we often have such package trouble
i think this can help a lot
then we can always use canjs as running meta repo
and upgrade that only if all works
Gregg Roemhildt
@roemhildtg
Jun 27 2017 14:15
That would actually be pretty convenient. npm install can and then imoprt 'can-define/map/map' would still work right?
Kevin Phillips
@phillipskevin
Jun 27 2017 14:17
yes
wait... maybe not
Gregg Roemhildt
@roemhildtg
Jun 27 2017 19:00
Yeah, you're right. It doesn't work. Even though node_modules/can-define/package.json exists, steal still says Error: Error loading "undefined" at <Anonymous Module 1> Did not find ./node_modules/can-define/package.json
Gregg Roemhildt
@roemhildtg
Jun 27 2017 19:33
But this does work:
import can from 'can';
window.can = can;

setTimeout(function(){
  steal.import('can-define/map/map').then(map => {
    window.map = map; // DefineMap
  })
})
This also works:
<script src="./node_modules/steal/steal.js" main="can">
  import DefineMap from 'can-define/map/map';
</script>
so I guess as long as can is loaded first, steal recognizes that can-define is there, but otherwise it does not