karaxnim / karax

Karax. Single page applications for Nim.
MIT License
1.07k stars 90 forks source link

nimble install: system module needs string #14

Closed vindarel closed 7 years ago

vindarel commented 7 years ago

Hi there, I wanted again to try Karax with Nim 0.17.0 and a "nimble install" at the project root gives me

$ nimble install                                                           *[master] 
     Info Hint: used config file '/etc/nim.cfg' [Conf]
     Error: Could not read package info file in /home/vince/bacasable/karax/karax.nimble;
        ...   Reading as ini file failed with: 
        ...     Invalid section: .
        ...   Evaluating as NimScript file failed with: 
        ...     Error: system module needs 'string'.

If it is not necessary to do that (as discussed in https://github.com/pragmagic/karax/issues/2), then I have the same errors as discussed here https://github.com/pragmagic/karax/issues/6#issuecomment-299133321

meaning with nim js todoapp.nim:

/home/vince/bacasable/karax/src/components.nim(82, 13) Error: type mismatch: got (NimNode, proc (bl: typed, op: string): NimNode{.noSideEffect.}, void)
but expected one of: 
proc add(x: var cstring; y: cstring)
proc add[T](x: var seq[T]; y: openArray[T])
proc add(x: var string; y: cstring)
proc add[T](x: var seq[T]; y: T)
proc add(x: var string; y: string)
proc add(x: var string; y: char)
proc add(parent, kid: VNode)
proc add(c: ClassList; class: cstring)
proc add[A, B](t: var OrderedTable[A, B]; key: A; val: B)
proc add(father, child: NimNode): NimNode
proc add[A, B](t: TableRef[A, B]; key: A; val: B)
proc add(father: NimNode; children: varargs[NimNode]): NimNode
proc add[A, B](t: var Table[A, B]; key: A; val: B)
proc add[A, B](t: OrderedTableRef[A, B]; key: A; val: B)
bluenote10 commented 7 years ago

Regarding the second error: Are you running this from within the Karax repo or from a different place? It looks like for the time being you need a .nims file which points --path to your local karax/src directory. Otherwise I'm getting this error as well just from a plain include karaxprelude.

vindarel commented 7 years ago

I am running this from within the Karax repo (karax/examples/todoapp or just karax/).

bluenote10 commented 7 years ago

Strange, it works for from within the repo (using latest Nim devel). Maybe if you're on Windows, you have to change the path separator in the nims file?

vindarel commented 7 years ago

I'm on Debian.

(btw if you want me to try something with a .nims file and the --path please explain, your precedent comment is cryptic to me :] )

bluenote10 commented 7 years ago

The .nims allows to specify an additional search path for the compiler. I think this was needed because of the dom naming conflict of the dom module in the Nim standard library and Karax's extended dom module. Now that Karax's version is renamed to kdom I think this is no longer needed.

You are using the latest master of Karax and latest devel of Nim and there is still the issue from above?

vindarel commented 7 years ago

I got the latest master and it's beautiful now :) Very exciting.