Skip to content

Running etherdelta locally JSON error #108

Open
@akerbabber

Description

@akerbabber

Hi, i'm trying to understand how etherdelta works and to do so i am trying to run it locally.
After editing all URLs from absolute to relative addresses i get this error when it tries to load configuration files (main.json):

SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse ()
at Request.request [as _callback] (main.js:84118)
at self.callback (main.js:57552)
at Request.EventEmitter.emit (main.js:97019)
at Request.init (main.js:57612)
at new Request (main.js:57509)
at request (main.js:56359)
at EtherDelta.loadConfig (main.js:84116)
at EtherDelta.startEtherDelta (main.js:85994)
at EtherDelta.window.addEventListener (main.js:84111)

i have already tried to edit loadconfig method changing the URL to a local one but it stills give me the error
self.loadConfig = function loadConfig(callback) { const configName = getParameterByName("config") || "main"; const url = "/home/akerbabber/etherdelta.github.io/config/main.json"; request(url, (err, response, body) => { try { self.config = JSON.parse(body); self.utility = utility(self.config); callback() } catch (errCatch) { console.log(errCatch); throw new Error("Could not load config") } })
I would like to thank you for all the efforts you put in this awesome project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions