-
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
Getting Duktape::ReferenceError: after upgrading to version 2.0.1.0 #41
Comments
That is completely not an identifier though. The usage should something like this: # Do this once:
code = "(function(opts, pluginOpts) {return eval(process.apply(this, opts, pluginOpts));})"
@ctx.exec_script("code = #{code}")
# Every time you want to execute it:
@ctx.call_prop("code", *args) In ExecJS you want to use code = "(function(opts, pluginOpts) {return eval(process.apply(this, opts, pluginOpts));})"
context = ExecJS.compile("code = #{code}")
context.call("code", …) |
I'm not using ActionView::Template::Error (identifier '(function(opts, pluginOpts) {return eval(process' undefined):
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):1
app/views/layouts/application.html.erb:8:in `_app_views_layouts_application_html_erb__967139250_71511880' So the error in #38 doesn't occur but something this one does. To be fair I don't know how execjs should or might work. |
This is a duplicate of rails/execjs#45 essentially |
rails/execjs#46 fixed this issue for me. |
Yikes. Does no one maintain ExecJS anymore? |
I've asked for clarification here rails/execjs#76. |
Here's a monkey-patch that will make it work for now: Duktape::Context.prepend Module.new {
def call_prop(name, *args)
if name.is_a?(Array)
name = name.join(".")
end
exec_string("__call_prop = #{name}")
name = "__call_prop"
super
end
}
ctx = Duktape::Context.new
if ctx.call_prop("(function(a, b) { return a + b })", 1, 1) != 2
raise "Monkey-patch failed to apply"
end |
Thanks @judofyr, I will try the patch. |
Hello, any time I try to bundle install on my server I have this error
/usr/local/rvm/rubies/ruby-2.5.1/bin/ruby -r ./siteconf20181115-158871-ab9r3y.rb extconf.rb current directory: /usr/local/rvm/gems/ruby-2.5.1/gems/duktape-1.3.0.3/ext/duktape current directory: /usr/local/rvm/gems/ruby-2.5.1/gems/duktape-1.3.0.3/ext/duktape make failed, exit code 2 Gem files will remain installed in /usr/local/rvm/gems/ruby-2.5.1/gems/duktape-1.3.0.3 for inspection. |
Woah. You're getting an internal GCC bug when compiling |
This original issue was fixed by rails/execjs#77. kokblan's compilation error is unrelated to this. |
Just upgraded to use 2.0.1.0 to verify #38 but got
The error is raised by line
where identifier is
The text was updated successfully, but these errors were encountered: