Skip to content

[Workaround] Master branch won't build locally due an error importing GLPK #155

@Makeshift

Description

@Makeshift

I know you're aware of this one and you provided a workaround in Discord a while back, but I thought I'd share the workaround for anyone wanting to run a dev instance locally.

Replace line 19 and 20 in this file:

import GLPKConstructor, { GLPK, LP, Result } from "glpk.js";
//declare const GLPKConstructor: () => GLPK;

with:

import { GLPK, LP, Result } from "glpk.js";
declare const GLPKConstructor: () => GLPK;

Local instances should now build and from a quick play around, seems to work fine.

If a diff is easier:

From 94306cbde2becb5284e2ac757b3333dc9fe28da4 Mon Sep 17 00:00:00 2001
From: "Connor Bell (Makeshift)" <git@connor-bell.com>
Date: Sun, 23 Jul 2023 14:10:06 +0100
Subject: [PATCH] Workaround for GLPK import error

---
 .../subpages/theorizer-page/theorizer-page.component.ts       | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/app/components/authenticated-v2/subpages/theorizer-page/theorizer-page.component.ts b/src/app/components/authenticated-v2/subpages/theorizer-page/theorizer-page.component.ts
index e7e3344..adf07f6 100644
--- a/src/app/components/authenticated-v2/subpages/theorizer-page/theorizer-page.component.ts
+++ b/src/app/components/authenticated-v2/subpages/theorizer-page/theorizer-page.component.ts
@@ -16,8 +16,8 @@
  */
 
 import { Component, OnInit } from "@angular/core";
-import GLPKConstructor, { GLPK, LP, Result } from "glpk.js";
-//declare const GLPKConstructor: () => GLPK;
+import { GLPK, LP, Result } from "glpk.js";
+declare const GLPKConstructor: () => GLPK;
 import { ModifierType } from "src/app/data/enum/modifierType";
 import { IInventoryArmor } from "../../../../data/types/IInventoryArmor";
 import { ArmorSlot } from "../../../../data/enum/armor-slot";
-- 
2.25.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions