riot / compiler

Riot.js compiler
MIT License
64 stars 29 forks source link

Emit compiler warning, if riot script tag is outside of root tag #130

Closed mojo2012 closed 4 years ago

mojo2012 commented 4 years ago

Help us to manage our issues by answering the following:

  1. Describe your issue: I was wondering for half an hour why this didn't work:

    <header class="mdl-layout__header">
    <div class="mdl-layout__header-row">
        <!-- Title -->
        <span class="mdl-layout-title">{props.title}</span>
    
        <slot name="items-left"></slot>
    
        <!-- Add spacer, to align navigation to the right -->
        <div class="mdl-layout-spacer"></div>
    
        <slot name="items-right"></slot>
    </div>
    </header>
    
    <script lang="ts">
        import { UINavbar } from "./UINavbar.ts";
        export default new UINavbar();
    </script>

There was no warning or error message. It did even render on screen, just the script tag was ignored.

  1. Can you reproduce the issue? Yes always

  2. How would you tag this issue?

    • [ ] Question
    • [x] Bug
    • [ ] Discussion
    • [x] Feature request
    • [ ] Tip
    • [x] Enhancement
    • [ ] Performance
GianlucaGuarini commented 4 years ago

@mojo2012 that's a good Idea thank you for your feedback