-
Notifications
You must be signed in to change notification settings - Fork 7
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
ActionView::Template::Error (invalid regexp character): Error on newly created rails app on Windows #38
Comments
@KapilSachdev Could you provide the source line producing the error? |
@svaarala , ActionView::Template::Error (invalid regexp character):
5: <%= csrf_meta_tags %>
6: <%= csp_meta_tag %>
7:
8: <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
9: <% <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> %>
10: </head>
11:
(execjs):24531
app/views/layouts/application.html.erb:8:in `_app_views_layouts_application_html_erb__393616251_122130440' (updated the above description too) |
But that's not javascript source line causing the issue ("invalid regexp character"). So I'm basically looking for the offending RegExp. |
Well I haven't dig into that as I moved on to other stuff and that's why reported here. |
Hi @svaarala, I think i found it. function parseSourceMapInput(str) {
return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ''));
} When I execute this (using execjs with duktape), I could reproduce ExecJS.compile(source) # source being the JS |
Minimal test case: Duktape::Context.new.eval_string('/]/.source') The regexp |
The technical background is that e.g. Duktape supports parts of the legacy Annex B regexp syntax, but not all of it. However,
|
I guess I should release Duktape 2.0 then |
Duktape.rb 2.0.1 is now released and things should work as expected. |
@judofyr, Encountering new issue after the latest release. |
Hi @judofyr
The default JavaScript engine on Windows is now duktape.
The issue occurs when using the gem bootstrap-rubygem with duktape as JS runtime. Changing
EXECJS_RUNTIME
to any other resolves the issue.So looks like duktape has some compilation issues.
Steps to reproduce
Now Browse to http://localhost:3000/welcome/index
Expected behavior
It should show the index page with bootstrap css and js included.
Actual behavior
It raises the error
System configuration
Rails version: 5.2.0
Ruby version: ruby 2.5.1p57 (2018-03-29 revision 63029) [x64-mingw32]
Logging bootstrap-rubygem issue.
Including @larskanis due to PR
Thanks
The text was updated successfully, but these errors were encountered: