Following the official example from here you will encounter the following error:
Argument of type 'import("/<project_path>/node_modules/@azure/storage-blob/dist/commonjs/ContainerClient").ContainerClient' is not assignable to parameter of type 'import("/<project_path>/node_modules/@azure/storage-blob/dist/esm/ContainerClient", { with: { "resolution-mode": "import" } }).ContainerClient'.
Types have separate declarations of a private property 'containerContext'.ts(2345)
To address this issue you need to type-cast using "any". Example:
import {BlobServiceClient} from '@azure/storage-blob';
import {FileStorage} from '@flystorage/file-storage';
import {AzureStorageBlobStorageAdapter} from '@flystorage/azure-storage-blob';
const blobService = BlobServiceClient.fromConnectionString(process.env.AZURE_DSN!);
const container = blobService.getContainerClient('flysystem');
const adapter = new AzureStorageBlobStorageAdapter(container as any); // <-- I've added "as any"
const storage = new FileStorage(adapter);
Here is my package.json version:
"@azure/storage-blob": "^12.28.0",
"@flystorage/azure-storage-blob": "^1.2.0",
"@flystorage/file-storage": "^1.2.0",
Following the official example from here you will encounter the following error:
To address this issue you need to type-cast using "any". Example:
Here is my package.json version: