fix(oss): use list() instead of getBucketInfo() in ensureBucket to avoid bundling issue (#6833)
When using OSS storage with Next.js, getBucketInfo() triggers
"ReferenceError: name is not defined" at startup. This happens because
the ali-oss SDK references a variable named `name` internally in its
createRequest function, which conflicts with the global `name` property
in bundled JavaScript environments.
Replacing getBucketInfo() with list({ 'max-keys': 1 }) achieves the same
goal (verifying the bucket is accessible) while avoiding the problematic
code path. The list() method is already used successfully elsewhere in
the OSS adapter.
Fixes #6552
Co-authored-by: octo-patch <octo-patch@github.com>
Showing
Please
register
or
sign in
to comment