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

svg in tag breaks in 2.3.21 #45

Closed
justinmchase opened this issue Jan 15, 2016 · 13 comments
Closed

svg in tag breaks in 2.3.21 #45

justinmchase opened this issue Jan 15, 2016 · 13 comments

Comments

@justinmchase
Copy link

We just did an npm install and are experiencing a hang in our build process now.

We tracked the hang down to a change in versions from riot-compiler@2.3.20 to riot-compiler@2.3.21.

We then went into the tag causing the hang and deleted some code until the problem went away. It turned out that our svg content is causing a problem with the riot-compiler to surface.

Here is an example of the offending tag.

<icon-heart>
  <svg viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <path d="M16,28.261c0,0-14-7.926-14-17.046c0-9.356,13.159-10.399,14-0.454c1.011-9.938,14-8.903,14,0.454
    C30,20.335,16,28.261,16,28.261z"/>            
  </svg>
</icon-heart>
@aMarCruz
Copy link
Contributor

@justinmchase , the output that I get seems correct, can you check it please?:

//src: test/specs/fixtures/svg.tag
riot.tag2('icon-heart',
  '<svg viewbox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M16,28.261c0,0-14-7.926-14-17.046c0-9.356,13.159-10.399,14-0.454c1.011-9.938,14-8.903,14,0.454 C30,20.335,16,28.261,16,28.261z"></path> </svg>', '', '', function(opts) {
});

@justinmchase
Copy link
Author

When I run it like that I am not seeing a problem either. We are specifically using gulp-riot in our build to process the tags.

We are specifically using riot@2.3.1 and gulp-riot@0.4.4.

I'm trying to find a more targeted repro for you.

@justinmchase
Copy link
Author

I've attached a minimal reproduction of the issue.
repro-45.zip

Unzip then:

$ cd test
$ npm install
$ gulp good # success
$ gulp bad # hangs

You'll see that the good.tag processes without error, as expected, but bad.tag when run through the same pipeline causes gulp to hang, no error is produced, and no tag file is generated.

@aMarCruz aMarCruz added the bug label Jan 15, 2016
@aMarCruz
Copy link
Contributor

@justinmchase , this is a bug. Please use a previous riot version, I will fix this issue ASAP.

@justinmchase
Copy link
Author

For anyone encountering this issue the workaround was to add "riot-compiler": "2.3.20" to my main package.json which causes it to use that version specifically.

@mattbailey
Copy link

Had this issue too, oof that was a hard one to track down...

To provide some content, this was causing webpack to hang with riotjs-loader, I have a tag with a svg in it as well.

@aMarCruz
Copy link
Contributor

The error is in a regex parsing quoted attribute values.

@aMarCruz
Copy link
Contributor

Please test with v2.3.22, it is already in npm.

@mattbailey
Copy link

Appears to work now, thanks @aMarCruz !!!

@justinmchase
Copy link
Author

Works for me too. I'm closing this for now as fixed by #44

@justinmchase
Copy link
Author

So unfortunately I had to revert back to 2.3.20 again because, while this seems to work at first it is still hanging our build. It does successfully generate the files and the compiler seems to work but it then hangs open our gulp process and it cannot be killed with Ctrl+c.

Revertting back to the older version fixes the problem. I'm not totally sure but it seems like a callback may not be called in this situation.

@justinmchase
Copy link
Author

Shoot false alarm, I think it's something else taht was masked by this problem after all. Sorry.

@aMarCruz
Copy link
Contributor

good to hear it.

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

No branches or pull requests

4 participants