StiffJobsS
Convex Community6mo ago
4 replies
StiffJobs

Convex R2 component not working when imported

When import convex r2 component to convex.config.ts
import r2 from '@convex-dev/r2/convex.config';
import shardedCounter from '@convex-dev/sharded-counter/convex.config';
import { defineApp } from 'convex/server';

const app = defineApp();

app.use(shardedCounter);
app.use(r2);

export default app;
it causes the error like

[ERROR] Could not resolve "tslib"

node_modules/@aws-crypto/sha256-js/build/module/jsSha256.js:1:39:
1 │ import { awaiter, generator } from "tslib";
~~~

You can mark the path "tslib" as external to exclude it from the bundle, which will
remove this error and leave the unresolved path in the bundle.

[ERROR] Could not resolve "tslib"
Was this page helpful?