question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Server side rendering fails with identifier 'Set' undefined

See original GitHub issue

Steps to reproduce

  • Make any old component
  • Set prerender to true
  • Try to render the component

Expected behavior

It should pre-render the component.

Actual behavior

Execjs crashes with the following error:

ExecJS::ProgramError (identifier 'Set' undefined):
  
(execjs):1
app/controllers/entry_point_controller.rb:3:in `index'

System configuration

Sprockets or Webpacker version: webpacker (3.5.5) React-Rails version: react-rails (2.4.7) React_UJS version: “react_ujs”: “^2.4.4” Rails version: rails (5.2.1) Ruby version: RUBY VERSION: 2.4.4 (2018-03-28 patchlevel 296) [i386-mingw32]

Basically everything works perfectly fine, but if I attempt to use server-side rendering, the program crashes with the above error: identifier 'Set' undefined. I thought it might have been due to an outdated, but I updated to the latest node and the issue persists.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
BookOfGregcommented, Oct 20, 2018

OH! You’re using your system NodeJS Do bundle add mini_racer and it will start working for you. Execjs automatically loads system JS runtime, which is Chakra on Windows, JSCore on OSX, and usually NodeJS if available. We only support Node > 6 (I think, It’s whichever one added ES6 and the new JSX features), therefore we do not support therubyracer as it’s using libv8-v3 which is far too old.

Upgrade your node to > 6, or include mini_racer.

0reactions
BookOfGregcommented, Nov 10, 2018

@rahulakurati Glad that solved it for you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to properly deal with window=undefined error in react ...
i'm getting the error because for some reason. the server is also looking at window.__INITIAL_STATE__ as well. So the problem is i cannot...
Read more >
Angular Universal: Complete Practical Guide
This post will be a complete practical guide for getting started with Angular Universal. We are going to go start with an existing...
Read more >
Is an undefined actually undefined? - JavaScript in Plain English
TL;DR undefined is not a restricted keyword so we can name by mistake our variable “undefined” and set a value to it which...
Read more >
Implementing SSR in Next.js: Dynamic routing and prefetching
Server -side rendering (SSR) has become a widely adopted technique to enhance the performance and SEO of web applications. And while static site ......
Read more >
Call JavaScript functions from .NET methods in ASP.NET Core ...
In Blazor Server apps, JavaScript (JS) interop may fail due to networking ... When SignalR server-side logging is set to Debug or Trace, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found