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

type riot/tag not supported by Google Chrome #2218

Closed
1 of 7 tasks
PascalLeMerrer opened this issue Jan 12, 2017 · 4 comments
Closed
1 of 7 tasks

type riot/tag not supported by Google Chrome #2218

PascalLeMerrer opened this issue Jan 12, 2017 · 4 comments
Labels

Comments

@PascalLeMerrer
Copy link

  1. Describe your issue:

When I include a tag with the type riot/tag

    <script src="tags/mytag.tag" type="riot/tag"></script>

Chrome displays a warning:

Fetching scripts with an invalid type/language attributes is deprecated and will be removed in M56, around January 2017. See https://www.chromestatus.com/features/5760718284521472 for more details

But if I remove the type, loading the tag generates an error:

Uncaught SyntaxError: Unexpected token <
  1. Can you reproduce the issue?

The issue is visible in the default bug template on PLNKR:

  1. On which browser/OS does the issue appear?

Google chrome

  1. Which version of Riot does it affect?

V3

  1. How would you tag this issue?
  • Question
  • Bug
  • Discussion
  • Feature request
  • Tip
  • Enhancement
  • Performance
@sourcegr
Copy link
Contributor

sourcegr commented Jan 12, 2017

please use data-src instead of src

for example:

<script type="riot/tag" data-src="/js/admin/tags/sre/sre-app.tag"></script>

@syuilo
Copy link
Contributor

syuilo commented Jan 12, 2017

related to #2132

@PascalLeMerrer
Copy link
Author

PascalLeMerrer commented Jan 12, 2017

I closed the issue too fast
When replacing src with data-src, another error occurs:

    at mountTo (riot+compiler.js:2502)
    at pushTagsTo (riot+compiler.js:1888)
    at each (riot+compiler.js:803)
    at pushTagsTo (riot+compiler.js:1893)
    at Object.mount$1 [as mount] (riot+compiler.js:1943)
    at riot+compiler.js:3496
    at compile (riot+compiler.js:3477)
    at Object.mount$$1 [as mount] (riot+compiler.js:3496)
    at mount ((index):56)
    at (index):62

The line 62 in index.html is

riot.mount('login')

And I loaded the 'login' tag source with:

<script data-src="tags/login.tag" type="riot/tag"></script>

With the src attribute, it works (but I have the Chrome warning)

@PascalLeMerrer
Copy link
Author

OK, I get it: I was making my tests on a branch using Riot 3.0.2., while this feature was added to a more recent 3.0 release.

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

No branches or pull requests

4 participants