evidence: Filters are not working on deployed site

See slack thread

Steps To Reproduce

  1. Removed .evidence folder
  2. Removed .build folder
  3. Ran npm run sources
  4. Ran npm run build
  5. cd build
  6. Host folder using http: http
  7. Open http://localhost:8000/ in new private windows (Firefox Developer Edition)

Environment

"dependencies": {
    "@evidence-dev/bigquery": "^2.0.3",
    "@evidence-dev/core-components": "^3.2.0",
    "@evidence-dev/csv": "^1.0.4",
    "@evidence-dev/databricks": "^1.0.2",
    "@evidence-dev/duckdb": "^1.0.4",
    "@evidence-dev/evidence": "^26.0.0",
    "@evidence-dev/mssql": "^1.0.4",
    "@evidence-dev/mysql": "^1.0.2",
    "@evidence-dev/postgres": "^1.0.2",
    "@evidence-dev/snowflake": "^1.0.2",
    "@evidence-dev/sqlite": "^2.0.2",
    "@evidence-dev/trino": "^1.0.3",
    "mermaid": "^10.7.0"
  },
  "overrides": {
    "jsonwebtoken": "9.0.0",
    "trim@<0.0.3": ">0.0.3",
    "sqlite3": "5.1.5",
    "mysql2": "3.8.0"
  }
  • Browser: Firefox

Expected Behavior

Actual Behaviour

most things looks and acts normal. But on one page we use dropdowns to filter data. That page stops working (either no change when changing filter or no data at all).

When running npm run dev, directly in same folder this works. I can use the dropdowns and the components referring the data is updated.

image

image

About this issue

  • Original URL
  • State: closed
  • Created 5 months ago
  • Comments: 22 (11 by maintainers)

Most upvoted comments

Appears to have been a duckdb-based error, as upgrading to duckdb-wasm 1.28.0 fixes, so reopening pending that version bump.

@ItsMeBrianD might have some better ideas here, as he was recently deploying evidence using nginx.

I believe there are certain file types that are not served correctly by nginx by default

Here is a sample that reproduces the behaviour (no update on filter change).

evidence-issue-1566.zip

Preparation

npm install
npm run sources

Working Scenario

  1. Start dev server

    npm run dev
    
  2. Open browser http://localhost:3000/

  3. Use the filter

  4. Confirm bar chart updates

Not Working Scenario

  1. Build static page

    npm run build
    
  2. Start some web server hosting static pages, I am using https://github.com/cortesi/devd

    cd build
    devd .
    
  3. Open browser http://localhost:8000/

  4. Use the filter

  5. Confirm bar chart does not update anymore

    • Console now contains error:
      Uncaught (in promise) Error: Invalid Input Error: File 'csv_data_ingestion_system_type_statistics.parquet' too small to be a Parquet file
      

Observations

  • My folder name is called csv and the source name in connection.yaml is called csv_data
    • Do these need to be in sync?
      • Renaming the folder to csv_data did not help
  • My problem seems to come from the data itself, especially how dates are coming from csv to duckdb (the date column have dates in YYYY-MM-DD format)
  • Trying to convert the csv data to a sqlite file also gave me some trouble
    • Sqlite Documentation is unclear/wrong

      SQLite is a local file-based database. It should be stored in the root of your Evidence project.

      This does not seem to be true. I must place the sqlite file under sources\<mydatasourcename> and also add a connection.yaml file similar to

      name: agentdata
      type: sqlite
      options:
        filename: agentdata.sqlite
      

      This works to get the data, but generates a warning when I run npm run sources as it tries to process all files in the source folder (including the sqlite file itself) and not only the .sql files