Skip to content
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

Uncaught ReferenceError: Map is not defined at line #617

Closed
ahiyalala opened this issue Oct 23, 2018 · 4 comments
Closed

Uncaught ReferenceError: Map is not defined at line #617

ahiyalala opened this issue Oct 23, 2018 · 4 comments

Comments

@ahiyalala
Copy link

I added the server.bundle.js and this error showed up. Upon looking at the bundle I figured out that it came from this line, it must have come from one of the 3rd party libraries that our other devs included but I can't be certain which one. I also figured out that it has something to do with the polyfills but I don't know how to resolve that as well:

`var scheduleWork = void 0;
var cancelScheduledWork = void 0;

if (!ExecutionEnvironment.canUseDOM) {
  var timeoutIds = new Map();

  scheduleWork = function (callback, options) {
    // keeping return type consistent
    var callbackConfig = {
      scheduledCallback: callback,
      timeoutTime: 0,
      next: null,
      prev: null
    };`
@Taritsyn
Copy link
Contributor

Hello!

You need to use a JS engine that supports ECMAScript 6: JavaScriptEngineSwitcher.ChakraCore and JavaScriptEngineSwitcher.V8. I recommend also reading the “Misconceptions about the JavaScript Engine Switcher version 2.X” discussion.

@ahiyalala
Copy link
Author

Hi @Taritsyn ! Thanks for your reply.

ChakraCore and V8 is already included in our solution and I've followed installing the native assemblies (JavaScriptEngineSwitcher.V8.Native.win-x86 and JavaScriptEngineSwitcher.V8.Native.win-x64.) but the app still renders the same error. Am I missing some steps?

@ahiyalala
Copy link
Author

Hi!

It's been resolved now. I just have to add this on Configure:

engineSwitcher.EngineFactories.AddChakraCore()
                                          .AddV8();

@Taritsyn
Copy link
Contributor

I would also add the following line after:

...
engineSwitcher.DefaultEngineName = V8JsEngine.EngineName;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants