evidence-dev / evidence

Business intelligence as code: build fast, interactive data visualizations in SQL and markdown
https://evidence.dev
MIT License
4.49k stars 216 forks source link

[Bug]: Build fails when using base path #2841

Open owenmorris opened 2 days ago

owenmorris commented 2 days ago

Describe the bug

I am deploying to a subfolder, I have set the basePath: variable in evidence.config.yaml as per the base path docs. When building I get an error as below:

node:internal/event_target:1090 process.nextTick(() => { throw err; }); ^ Error: 404 / does not begin with base, which is configured in paths.base and can be imported from $app/paths - see https://kit.svelte.dev/docs/configuration#paths for more info (linked from //) To suppress or handle this error, implement handleHttpError in https://kit.svelte.dev/docs/configuration#prerender at file:///Users/owen/repos//evidence/node_modules/@sveltejs/kit/src/core/config/options.js:202:13 at file:///Users/owen/repos//evidence/node_modules/@sveltejs/kit/src/core/postbuild/prerender.js:65:25 at visit (file:///Users/owen/repos//evidence/node_modules/@sveltejs/kit/src/core/postbuild/prerender.js:195:4) at Object.fn (file:///Users/owen/repos//evidence/node_modules/@sveltejs/kit/src/core/postbuild/prerender.js:184:22) at dequeue (file:///Users/owen/repos//evidence/node_modules/@sveltejs/kit/src/core/postbuild/queue.js:40:42) at file:///Users/owen/repos//evidence/node_modules/@sveltejs/kit/src/core/postbuild/queue.js:49:7

It's failing running npx vite build in node_modules/@evidence-dev/evidence/cli.js:190

Steps to Reproduce

Create evidence app Set basePath: in evidence.config.yaml npm run build

This should fail after bundling

Logs

System Info

System:
    OS: macOS 14.6.1
    CPU: (6) x64 Intel(R) Core(TM) i5-8500B CPU @ 3.00GHz
    Memory: 3.04 GB / 32.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 22.11.0 - /usr/local/bin/node
    npm: 10.9.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 131.0.6778.86
    Safari: 17.6
  npmPackages:
    @evidence-dev/bigquery: ^2.0.7 => 2.0.8 
    @evidence-dev/core-components: ^4.9.0 => 4.9.0 
    @evidence-dev/csv: ^1.0.12 => 1.0.13 
    @evidence-dev/databricks: ^1.0.7 => 1.0.7 
    @evidence-dev/duckdb: ^1.0.11 => 1.0.12 
    @evidence-dev/evidence: ^39.2.0 => 39.2.0 
    @evidence-dev/motherduck: ^1.0.2 => 1.0.3 
    @evidence-dev/mssql: ^1.1.1 => 1.1.1 
    @evidence-dev/mysql: ^1.1.3 => 1.1.3 
    @evidence-dev/postgres: ^1.0.6 => 1.0.6 
    @evidence-dev/snowflake: ^1.0.7 => 1.2.1 
    @evidence-dev/sqlite: ^2.0.5 => 2.0.6 
    @evidence-dev/trino: ^1.0.7 => 1.0.8 
    bits-ui: ^0.21.13 => 0.21.16 
    clsx: ^2.1.1 => 2.1.1 
    lucide-svelte: ^0.438.0 => 0.438.0 
    tailwind-merge: ^2.5.2 => 2.5.4 
    tailwind-variants: ^0.2.1 => 0.2.1 
    typescript: ^5.4.2 => 5.4.2 
    vite: ^5.4.11 => 5.4.11

Severity

blocking all usage of Evidence

Additional Information, or Workarounds

No response

archiewood commented 2 days ago

please provide the evidence.config.yaml file you used

Note the format required, leading slash

deployment:
  basePath: /my-base-path