JSON::GeneratorError after moving from 1.4.0 to 2.0.x
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
Start with the failing app/views/admin/stats/stats.js.coffee template and trace compilation through coffee-script/lib/coffee_script.rb and execjs (2.0.0) lib/execjs/external_runtime.rb. Compare the behavior with ExecJS 1.4.0 using the shown template and error, then determine the supported input and output behavior for this case.
Written by the indexing model from the issue text.
Description
I'm just moving a previous issue from the old repo here. Is there a way of doing this using ExecJS > 1.4.0?
Using this in a js.coffee erb template
$("#stats").replaceWith("<%= escape_javascript(render @template) %>")
now causes this error
JSON::GeneratorError - only generation of JSON objects or arrays allowed:
/Users/Nick/.rbenv/versions/1.9.3-p327/lib/ruby/1.9.1/json/common.rb:216:in `generate'
/Users/Nick/.rbenv/versions/1.9.3-p327/lib/ruby/1.9.1/json/common.rb:345:in `dump'
execjs (2.0.0) lib/execjs/external_runtime.rb:19:in `eval'
execjs (2.0.0) lib/execjs/external_runtime.rb:33:in `call'
coffee-script (2.2.0) lib/coffee_script.rb:57:in `compile'
app/views/admin/stats/stats.js.coffee:1:in `_app_views_admin_stats_stats_js_coffee___1014294459951170846_70216695895960'
This worked just fine with 1.4.0 Should a different approach now be used?
- Dominant language
- Ruby
- Stars
- 581
- Forks
- 285
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rails/execjs
-
Runtime stderr is missing from ruby error messagePossibly taken @arpitjain099 claimed this 168 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Similar issues
-
Bug Ruby Waiting for: Product Owner
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
getsentry/sentry-ruby#3228 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
開発用DockerイメージにPlaywrightのシステム依存を追加するPossibly taken @momocus claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
sakazuki-org/sakazuki#1453 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
jenkins-infra/jenkins.io#9615 · 1 comment ·
Maintainers usually reply within 1 day