Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i can't get the component to mount #41

Open
dharmax opened this issue Nov 22, 2016 · 10 comments
Open

i can't get the component to mount #41

dharmax opened this issue Nov 22, 2016 · 10 comments

Comments

@dharmax
Copy link

dharmax commented Nov 22, 2016

i use jspm.
i read the issues people have with riotts and jspm so i added riotts as a git submodule.
i built a tiny component and i followed the execution in the debugger:

  1. the registration seems perfectly fine, to the best of my discernment
  2. the mounting, however, doesn't find the component (although it finds another component that was defined normally, using a .tag file)
    How could that be...?
@nippur72
Copy link
Owner

so the problem is that you can't mount an element that was previously registered?

Please keep in mind that in a module-based scenario, the .ts file of an element must be imported before any mount occurs. E.g.

import "./my-tag"; // this registers the component 

riot.mount("*");

@dharmax
Copy link
Author

dharmax commented Nov 22, 2016

That's what i did. As i said, i followed the execution into your code. It even seems like it executed the following line element.prototype.tagName = registerTag(compiled); correctly.

i followed also the execution of the mount, and there i saw that it simply doesn't recognize the tag...

So i'm at lost..

@nippur72
Copy link
Owner

it's difficult to say. The only thing that comes into my mind is having two riot instances, you are registering in one but mounting with the other (just guessing).

If you can/want, setup a repo that I can clone and check.

@dharmax
Copy link
Author

dharmax commented Nov 23, 2016

It sounds very reasonable...i still don't see where riot was instantiated twice, though.

It is a private repository, but i can send you a tar/zip. it's very small, because it's in a boilerplate status. where can i send it to?

@nippur72
Copy link
Owner

@dharmax sent it to [email protected]

@dharmax
Copy link
Author

dharmax commented Nov 24, 2016

i sent it to you yesterday

@nippur72
Copy link
Owner

nippur72 commented Nov 24, 2016 via email

@dharmax
Copy link
Author

dharmax commented Nov 27, 2016 via email

@dharmax
Copy link
Author

dharmax commented Nov 29, 2016

Any new findings?

@foxik0169
Copy link

foxik0169 commented Apr 5, 2017

Same issue here... I use steal.js as module loader and even if I try to do everything in one file riot doesn't mount. I've looked if it isn't related to template or some issue with requests but everything downloads correctly only (I even tried calling riot.compile() with callback containing riot.mount()) riot.mount() returns empty array and nothing mounts.

Main.ts:

import riot = require('node_modules/riot/riot+compiler');
import './IDE';

riot.compile(() => {
    let tags = riot.mount('*');
    tags;
});

IDE.ts:

import * as Riot from 'riot-typescript';
import 'codemirror/lib/codemirror.css';
import * as CodeMirror from 'codemirror';
import * as EmmetCodemirror from 'emmet-codemirror';


@Riot.template('/_template/Administration/Templates/ACMS_IDE')
class IDE extends Riot.Element {

    attention: string = "yay";

}

ACMS_IDE (twig template rendered from php server with symfony):

{% raw %}
<ide>
    <div class="test">Testing, {{ attention }} please!</div>
</ide>
{% endraw %}

any suggestions? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants