EVE-Tools/element43

Error building vue43

Opened this issue · 4 comments

Hi,
When i try to build the docker image i get this error:

ERROR in /vue43/components/Search.vue.ts
[tsl] ERROR in /vue43/components/Search.vue.ts(63,7)
      TS2322: Type 'string | (string | null)[]' is not assignable to type 'string'.
  Type '(string | null)[]' is not assignable to type 'string'.

ERROR in ./node_modules/css-loader??ref--6-1!./node_modules/postcss-loader/lib??ref--6-2!./node_modules/stylus-loader??ref--6-3!./stylus/main.styl
Module build failed: Error: /vue43/node_modules/vuetify/src/stylus/components/_calendar-daily.styl:5:40
   1| @import '../bootstrap'
   2| @import '../theme'
   3|
   4| v-calendar-daily($material)
   5|   background-color: $material.calendar.background-color
---------------------------------------------^
   6|   .v-calendar-daily__intervals-head
   7|     border-right: $material.calendar.line-color 1px solid;
   8|   .v-calendar-daily_head-day

$material.calendar has no property .background-color
    at v-calendar-daily() (/vue43/node_modules/vuetify/src/stylus/components/_calendar-daily.styl:5:1)
    at ".theme--dark.v-calendar-daily" (/vue43/node_modules/vuetify/src/stylus/theme.styl:13:3)
    at dark() (/vue43/node_modules/vuetify/src/stylus/theme.styl:12:1)
    at theme() (/vue43/node_modules/vuetify/src/stylus/theme.styl:4:1)

    at CachedPathEvaluator.Evaluator.visitMember (/vue43/node_modules/stylus/lib/visitor/evaluator.js:351:11)
    at CachedPathEvaluator.Visitor.visit (/vue43/node_modules/stylus/lib/visitor/index.js:28:40)
    at CachedPathEvaluator.Evaluator.visit (/vue43/node_modules/stylus/lib/visitor/evaluator.js:160:18)
    at CachedPathEvaluator.Evaluator.visitExpression (/vue43/node_modules/stylus/lib/visitor/evaluator.js:644:26)
    at CachedPathEvaluator.Visitor.visit (/vue43/node_modules/stylus/lib/visitor/index.js:28:40)
    at CachedPathEvaluator.Evaluator.visit (/vue43/node_modules/stylus/lib/visitor/evaluator.js:160:18)
    at CachedPathEvaluator.Evaluator.visitExpression (/vue43/node_modules/stylus/lib/visitor/evaluator.js:644:26)
    at CachedPathEvaluator.Visitor.visit (/vue43/node_modules/stylus/lib/visitor/index.js:28:40)
    at CachedPathEvaluator.Evaluator.visit (/vue43/node_modules/stylus/lib/visitor/evaluator.js:160:18)
    at CachedPathEvaluator.Evaluator.visitProperty (/vue43/node_modules/stylus/lib/visitor/evaluator.js:687:22)
    at CachedPathEvaluator.Visitor.visit (/vue43/node_modules/stylus/lib/visitor/index.js:28:40)
    at CachedPathEvaluator.Evaluator.visit (/vue43/node_modules/stylus/lib/visitor/evaluator.js:160:18)
    at CachedPathEvaluator.Evaluator.visitBlock (/vue43/node_modules/stylus/lib/visitor/evaluator.js:720:39)
    at CachedPathEvaluator.Visitor.visit (/vue43/node_modules/stylus/lib/visitor/index.js:28:40)
    at CachedPathEvaluator.Evaluator.visit (/vue43/node_modules/stylus/lib/visitor/evaluator.js:160:18)
    at CachedPathEvaluator.Evaluator.invoke (/vue43/node_modules/stylus/lib/visitor/evaluator.js:1087:17)
 @ ./stylus/main.styl 4:14-187
 @ ./store/index.ts
 @ ./store ^\.\/(?!-)[^.]+\.(js|ts)$
 @ ./.nuxt/store.js
 @ ./.nuxt/index.js
 @ ./.nuxt/client.js

 ERROR

  Error: Webpack build exited with errors

I try to run the services using docker-compose. Here is my docker-compose.yml:

version : "3.7"

services:  
  vue:
    build: https://github.com/EVE-Tools/vue43.git
    container_name: vue43
    restart: unless-stopped

  esi-markets:
    build: https://github.com/EVE-Tools/esi-markets.git
    container_name: esi-markets
    environment:
      - REFRESH_TOKEN=
      - CLIENT_ID=
      - SECRET_KEY=
      - GRPC_HOST=43000
    networks:
      - gateway
    restart: unless-stopped

  static-data:
    build: https://github.com/EVE-Tools/static-data.git
    container_name: static-data
    environment:
      - LOG_LEVEL=info
      - PORT=43000
      - DB_PATH=static-data.db
      - ESI_HOST=esi.tech.ccp.is
      - STRUCTURE_HUNT_HOST=stop.hammerti.me.uk
      - DISABLE_TLS=false
    networks:
      - gateway
    restart: unless-stopped

  top-stations:
    build: https://github.com/EVE-Tools/top-stations.git
    container_name: top-stations
    environment:
      - CRON=@hourly
      - DB_PATH=/data/top-stations.db
      - LOG_LEVEL=info
      - ESI_MARKETS_HOST=esi-markets:43000
      - PORT=43000
    networks:
      - gateway
    restart: unless-stopped

  market-stats:
    build: https://github.com/EVE-Tools/market-stats.git
    container_name: market-stats
    environment:
      - SEED_DB=false
      - CRON=0 52 * * *
      - LOG_LEVEL=info
      - POSTGRES_URL=postgres://market-stats@localhost:5432/market-stats?sslmode=disable
      - PORT=43000
    networks:
      - gateway
    restart: unless-stopped

  jumpgate:
    build: https://github.com/EVE-Tools/jumpgate.git
    container_name: jumpgate
    environment:
      - LOG_LEVEL=
      - LISTEN_HOST=:8000
      - ESI_MARKETS_HOST=esi-markets:43000
      - MARKET_STATS_HOST=market-stats:43000
      - STATIC_DATA_HOST=static-data:43000
      - TOP_STATIONS_HOST=top-stations:43000
    ports:
      - 8000:8000
    restart: unless-stopped

networks:
  gateway:

@11philip22 Thank you for taking time to report this issue. I am not sure if the project is still maintained, to be honest.

Maybe @zweizeichen has time to take a look.

@jenslauterbach Hi, it's been a while :)

@11philip22 Thanks for reporting and your interest in our project :) @jenslauterbach was right. As you can probably guess from EVE-Tools/vue43's general state, it has not been maintained for quite a while. At first glance it seems like some attribute(s) in the theme are missing. This is probably due to a more recent version of vuetify introducing additional properties. You could try pinning vuetify to 1.0.7, however I'm not sure this would work. I guess themes could be implemented in a less hacky way (like properly merging data structures in Stylus) which would prevent issues like this in the future. Even if this would work, most of the other dependencies would still be horribly outdated though.

I'm not even sure client-side rendering is such a smart idea for EVE apps as you're handling large volumes of highly relational data (orders->stations->systems->regions, inentoryTypes etc.) and you tend to write a lot of boilerplate code just to get an order to appear in the user's browser. It may be smarter easier and more maintainable to just fetch that data on the server side (or even keep it in a DB seeded from ESI) and simply pass the client some pre-rendered HTML like in the good old days(tm). Maybe open a websocket connection listening for updates streamed by esi-markets and then refresh the page once there are new orders. Vue43 was a bit of an experiment in that regard and it turned out that a lot of data was sent around which often resulted in a suboptimal user experience. It also used lots of memory for server-side-rendering. I really liked the design though :) Reducing data sent to the client by providing a graphql backend also led to mixed results as we'd often have to load thousands of entities to e.g. display all orders for a busy item such as Tritanium. Turns out that most graphql frameworks (at least back then) seemed not to be designed for that use case. You could make it work in Go but again that solution was a bit over-engineered to say the least.

The lack of maintenance combined with the high velocity in the JS front-end space (for example Typescript support in the vue ecosystem seems to have come a long way since vue43 was originally implemented) has led to vue43 probably needing something akin to a full rewrite to be honest. While there is a decent chance of the backend services still functioning fine or just needing a few fixes here and there, I'm afraid vue43 might be beyond salvage at this point (I have not taken a closer look at the situation though). So I would kindly ask you to take a step back and maybe tell us what you're trying to achieve. We might be able to provide you with some directions. You may be better off simply re-using parts of our backend and writing a front-end system of your own rather than porting vue43 to a recent version of nuxt.

HI, Thanks for the quick response guys.
What i am trying to achieve is to create a tool that lists all profitable items for trading between jita and a private structure.
Kinda like what Goonswarm has with goonmetrics. https://goonmetrics.apps.goonswarm.org/importing/1030049082711/markup/

Happy to help! That should actually not be too difficult. You may not even need element43 services for that. In fact, you may not even need a 'real' web application or database at all: You'd basically write a Python script or Go program (whatever you like best and has an ESI client library available) to fetch the data and output an HTML file or even easier CSV every X minutes/daily with a cron job. You can then serve that file with any HTTP server (such as nginx) or open the CSV in your favorite spreadsheet tool.

There's a catch, however. Unless they added an endpoint to ESI (IIRC there is none), you do not know the historic volume of items traded in your structure as ESI only supplies region-level volume data for trade. This makes it difficult/impossible to estimate an item's potential profit unless the structure is the main trade hub in that region. What you do have access to though are the orders in your structure's market.

So the first question you want to answer is what your import strategy would be: Do you want to trade based on comparing current Jita prices with current prices in your structure or do you want to trade based on historic (e.g. weekly) averages in regional prices? Or do you maybe want to employ a hybrid strategy? If you are lucky to supply a trade hub, trading based on historic averages is a potentially safe option as they are based on trades which actually took place. Whereas order data is generally skewed by scam orders. So calculating averages won't get you that far unless you're doing some fancy statistics and even then you do not know if items are actually traded for that price unless there's a lot of volume in the market. Also, when an order disappears from the orderbook you do not know if it was fulfilled or if the order's owner deleted it.

For example, a very simple import tool would compare last 7 day's sum of daily volume multiplied by average daily price for each item between two regions and output those items with the highest difference. This could provide hints towards items which may have a somewhat stable price difference between two regions (always double check with a market viewer, sometimes one market may be just lagging behind the other). Another short-term option would be downloading all orders in two regions or stations and comparing those to see if you can simply haul goods from A(sk) to B(id) which is more similar to a classic trade finder.

Note: If you want to trade based on your structure's market, you need authentication for requesting data as your structure is, well, private. Head over to https://developers.eveonline.com/ and create an application with the permission to read structure markets. Then, use https://github.com/EVE-Tools/element43/blob/master/util/tokenfetcher.py and edit-in the client secret and id as well as the scopes to fetch a token you can use to query ESI on behalf of the character you picked when running that script (the character obviously should have access to the structure). You can then use that token for making requests on behalf of that character in the future. Keep these IDs and tokens secret!