-
Notifications
You must be signed in to change notification settings - Fork 26
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
Typescript JSX output is incompatible with html tags in regex expressions #45
Comments
Yep, this is a bug. Unfortunately, it happens to show a weakness of the current compiler architecture. Currently, Surplus correctly handles text that looks like it might be a tag when it's inside strings or comments -- If it helps, you can work around the issue by just making a semantically meaningless change that separates the '<' from the first character of the tag, so convert I'm likely going to move to a more established JSX parser, like acorn, in the future, which would resolve this issue. |
Aha, I see! The workaround solved the problem, thanks for the tip! |
Hi,
And the source code in "path-parser" is:
Do you have any suggestions on this? By the way, thank you for a so great library. |
Hello!
I've recently started using Surplus and it's really great! But I think I've found a bug in the compiler:
This produces the error:
ERROR in ./public/js/controller.ts
Module build failed: Error: element missing close tag at line 19 col 25: ``
+/g, '\n');}
''
at ERR (/node_modules/surplus/compiler/index.js:354:15)
at jsxElement (/node_modules/surplus/compiler/index.js:162:17)
at program (/node_modules/surplus/compiler/index.js:91:31)
at parse (/node_modules/surplus/compiler/index.js:83:12)
at Object.compile (/node_modules/surplus/compiler/index.js:1444:45)
at Object.preprocess (/node_modules/surplus-loader/index.js:7:33)
@ ./public/js/main.ts 3:7-49
I think the problem lies in the surplus-loader. Compiling the regex with Babel works fine when I test that!
Edit: I'm running the 0.5 beta of surplus-loader.
The text was updated successfully, but these errors were encountered: