redotvideo / revideo

Create Videos with Code
https://re.video
MIT License
2.58k stars 88 forks source link

BUG | No matching export in "chroma-js" for import "Color" and "mix" #228

Closed 1216892614 closed 3 months ago

1216892614 commented 3 months ago

Reproduction

  1. npm init @revideo@latest
    • ✔ Project name … my-revideo-project
    • ✔ Project path … my-revideo-project
    • ✔ Choose a starter template › Minial, standalone Revideo project
  2. cd ./my-revideo-project
  3. pnpm i
  4. npm run start

Deps

from package.json

  "dependencies": {
    "@revideo/2d": "^0.5.2",
    "@revideo/core": "^0.5.2",
    "@revideo/ffmpeg": "^0.5.2",
    "@revideo/renderer": "^0.5.2",
    "@revideo/vite-plugin": "^0.5.2",
    "chroma-js": "^2.6.0"
  },
  "devDependencies": {
    "@revideo/cli": "^0.5.2",
    "@revideo/ui": "^0.5.2",
    "typescript": "^5.2.2",
    "vite": "^4.5"
  }

from pnpm-lock.yaml

  '@revideo/core@0.5.2':
    dependencies:
      '@types/chroma-js': 2.4.4
      chroma-js: 2.6.0
      mp4-wasm: 1.0.6

Environment

Error logs

> npm run start                                                                                                                                                                                                                (base)

> my-revideo-project@0.0.0 start
> vite

  VITE v4.5.3  ready in 325 ms

  ➜  Local:   http://localhost:9000/
  ➜  Network: use --host to expose
  ➜  press h to show help
✘ [ERROR] No matching export in "node_modules/.pnpm/chroma-js@2.6.0/node_modules/chroma-js/index.js" for import "Color"

    node_modules/.pnpm/@revideo+core@0.5.2/node_modules/@revideo/core/lib/types/Color.js:1:9:
      1 │ import { Color, mix } from 'chroma-js';
        ╵          ~~~~~

✘ [ERROR] No matching export in "node_modules/.pnpm/chroma-js@2.6.0/node_modules/chroma-js/index.js" for import "mix"

    node_modules/.pnpm/@revideo+core@0.5.2/node_modules/@revideo/core/lib/types/Color.js:1:16:
      1 │ import { Color, mix } from 'chroma-js';
        ╵                 ~~~

/home/hndpp/Code/ts-playground/node_modules/.pnpm/esbuild@0.18.20/node_modules/esbuild/lib/main.js:1649
  let error = new Error(`${text}${summary}`);
              ^

Error: Build failed with 2 errors:
node_modules/.pnpm/@revideo+core@0.5.2/node_modules/@revideo/core/lib/types/Color.js:1:9: ERROR: No matching export in "node_modules/.pnpm/chroma-js@2.6.0/node_modules/chroma-js/index.js" for import "Color"
node_modules/.pnpm/@revideo+core@0.5.2/node_modules/@revideo/core/lib/types/Color.js:1:16: ERROR: No matching export in "node_modules/.pnpm/chroma-js@2.6.0/node_modules/chroma-js/index.js" for import "mix"
    at failureErrorWithLog (/home/hndpp/Code/ts-playground/node_modules/.pnpm/esbuild@0.18.20/node_modules/esbuild/lib/main.js:1649:15)
    at /home/hndpp/Code/ts-playground/node_modules/.pnpm/esbuild@0.18.20/node_modules/esbuild/lib/main.js:1058:25
    at /home/hndpp/Code/ts-playground/node_modules/.pnpm/esbuild@0.18.20/node_modules/esbuild/lib/main.js:1525:9
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  errors: [
    {
      detail: undefined,
      id: '',
      location: {
        column: 9,
        file: 'node_modules/.pnpm/@revideo+core@0.5.2/node_modules/@revideo/core/lib/types/Color.js',
        length: 5,
        line: 1,
        lineText: "import { Color, mix } from 'chroma-js';",
        namespace: '',
        suggestion: ''
      },
      notes: [],
      pluginName: '',
      text: 'No matching export in "node_modules/.pnpm/chroma-js@2.6.0/node_modules/chroma-js/index.js" for import "Color"'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 16,
        file: 'node_modules/.pnpm/@revideo+core@0.5.2/node_modules/@revideo/core/lib/types/Color.js',
        length: 3,
        line: 1,
        lineText: "import { Color, mix } from 'chroma-js';",
        namespace: '',
        suggestion: ''
      },
      notes: [],
      pluginName: '',
      text: 'No matching export in "node_modules/.pnpm/chroma-js@2.6.0/node_modules/chroma-js/index.js" for import "mix"'
    }
  ],
  warnings: []
}

Node.js v20.12.2
justusmattern27 commented 3 months ago

hey, thanks for reporting this! This is caused by a recent chroma-js release (2.5.0) that has breaking changes which affect revideo. You'll have to downgrade to 2.4.x to fix the issue.

PR #226 fixes this by pinning the chroma-js version. We'll release a new version that includes this fix today

1216892614 commented 3 months ago

hey, thanks for reporting this! This is caused by a recent chroma-js release (2.5.0) that has breaking changes which affect revideo. You'll have to downgrade to 2.4.x to fix the issue.

PR #226 fixes this by pinning the chroma-js version. We'll release a new version that includes this fix today

still not work. BTW, Im using bun this time.

package.json

  "dependencies": {
    "@revideo/2d": "^0.5.2",
    "@revideo/core": "^0.5.2",
    "@revideo/ffmpeg": "^0.5.2",
    "@revideo/renderer": "^0.5.2",
    "@revideo/vite-plugin": "^0.5.2",
    "chroma-js": "2.4.2"
  },
  "devDependencies": {
    "@revideo/ui": "^0.5.2",
    "@revideo/cli": "^0.5.2",
    "typescript": "^5.2.2",
    "vite": "^4.5"
  }

bun install --yarn

"@revideo/core@0.5.2", "@revideo/core@^0.5.2":
  version "0.5.2"
  resolved "https://registry.npmjs.org/@revideo/core/-/core-0.5.2.tgz"
  integrity sha512-/iZ4Vx1Rmv9m6uU/3gppCtyCZ5HRass9pv2at3iM2GPOew7H6AZN3HWBTFmmplBf+RGyGzlkaZPVsUBQk8KdCQ==
  dependencies:
    mp4-wasm "^1.0.6"
    chroma-js "^2.4.2"
    "@types/chroma-js" "^2.1.4"

Error logs

> bun run start                                                                                                                                                                                                                (base) 
$ vite

  VITE v4.5.3  ready in 348 ms

  ➜  Local:   http://localhost:9000/
  ➜  Network: use --host to expose
  ➜  press h to show help
✘ [ERROR] No matching export in "node_modules/@revideo/core/node_modules/chroma-js/index.js" for import "Color"

    node_modules/@revideo/core/lib/types/Color.js:1:9:
      1 │ import { Color, mix } from 'chroma-js';
        ╵          ~~~~~

✘ [ERROR] No matching export in "node_modules/@revideo/core/node_modules/chroma-js/index.js" for import "mix"

    node_modules/@revideo/core/lib/types/Color.js:1:16:
      1 │ import { Color, mix } from 'chroma-js';
        ╵                 ~~~
hkonsti commented 3 months ago

Thanks again for reporting! We just released 0.5.3, which should fix this issue. Please reopen in case you still face issues after upgrading.