Chart.js icon indicating copy to clipboard operation
Chart.js copied to clipboard

Error when trying to run locally the chart.js samples

Open aquino-luane opened this issue 1 year ago • 2 comments

Expected behavior

I cloned the chart.js repo in order to run the samples locally.

Current behavior

When I run command pnpm run docs:dev shows this error:

src/index.umd.ts → dist/chart.umd.js...
thread '<unnamed>' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc_ecma_transforms_module-0.186.3/src/path.rs:126:13:
base_dir(`./`) must be absolute. Please ensure that `jsc.baseUrl` is specified correctly. This cannot be deduced by SWC itself because SWC is a transpiler and it does not try to resolve project details. In other words, SWC does not know which directory should be used as a base directory. It can be deduced if `.swcrc` is used, but if not, there are many candidates. e.g. the directory containing `package.json`, or the current working directory. Because of that, the caller (typically the developer of the JavaScript package) should specify it. If you see this error, please report an issue to the package author.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[!] (plugin swc) Error: failed to handle: base_dir(`./`) must be absolute. Please ensure that `jsc.baseUrl` is specified correctly. This cannot be deduced by SWC itself because SWC is a transpiler and it does not try to resolve project details. In other words, SWC does not know which directory should be used as a base directory. It can be deduced if `.swcrc` is used, but if not, there are many candidates. e.g. the directory containing `package.json`, or the current working directory. Because of that, the caller (typically the developer of the JavaScript package) should specify it. If you see this error, please report an issue to the package author.
src/index.umd.ts
Error: failed to handle: base_dir(`./`) must be absolute. Please ensure that `jsc.baseUrl` is specified correctly. This cannot be deduced by SWC itself because SWC is a transpiler and it does not try to resolve project details. In other words, SWC does not know which directory should be used as a base directory. It can be deduced if `.swcrc` is used, but if not, there are many candidates. e.g. the directory containing `package.json`, or the current working directory. Because of that, the caller (typically the developer of the JavaScript package) should specify it. If you see this error, please report an issue to the package author.


 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.

Reproducible sample

https://www.chartjs.org/dist/master

Optional extra steps/info to reproduce

No response

Possible solution

No response

Context

I would like to be able to see chart examples in hope to find something similar to what I am trying to achieve

chart.js version

this repository's master branch

Browser name and version

No response

Link to your project

No response

aquino-luane avatar Aug 06 '24 08:08 aquino-luane

Have you found a solution?

Mofred1 avatar Jan 01 '25 17:01 Mofred1

Have you found a solution?

unfortunately not yet :/

aquino-luane avatar Jan 06 '25 01:01 aquino-luane