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

Changed Webpack versions to avoid build error #1

Closed
wants to merge 5 commits into from
Closed

Changed Webpack versions to avoid build error #1

wants to merge 5 commits into from

Conversation

stargazing-dino
Copy link

Following the directions in the readme I got this error trying to npm start:

npm-install-error

I think it's related to this issue. I just changed some library versions.

@stargazing-dino
Copy link
Author

stargazing-dino commented Mar 27, 2019

Actually, I'm not sure if this just created another problem. I'm now getting this error:

module-parse-failed

It might've been there before the change in Webpack versions though. I have no way of telling.

We could possibly change these lines to something like a switch statement:

function getAgentClass() {
  const agentName = getAgentName();
  return import(`./agents/${agentName}Agent`).then(
    ({ default: Agent }) => Agent
  );
}

-->

import PolicyAgent from "./agents/PolicyGradientAgent";
import KeyboardAgent from "./agents/KeyBoardAgent";
import RandomHillClimbingAgent from "./agents/RandomHillClimbingAgent";

function getAgentClass() {
  const agentName = getAgentName();
  let agent;
  switch (agentName) {
    case "Random":
      agent = new RandomHillClimbingAgent();
      break;
    case "Keyboard":
      agent = new KeyboardAgent();
      break;
    case "Policy":
      agent = new PolicyAgent();
      break;
    default:
      console.error("Unknown agent");
  }

  return agent
}

Otherwise, I think we'll need to mess with the Webpack settings.

@stargazing-dino
Copy link
Author

These changes have it working for me now on my end.

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

Successfully merging this pull request may close these issues.

None yet

1 participant