Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error bundling script using this package: Uncaught SyntaxError: Identifier xxx has already been declared #37

Open
ghost opened this issue Dec 9, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Dec 9, 2022

Describe the bug

Hi, when using deno bundle on a script that uses this package I get a range of errors when running the bundled files.

Your environment

SDK version number

aws_sdk@v3.32.0-1/client-s3

Details of the deno version

deno 1.26.1 (release, aarch64-apple-darwin)
v8 10.7.193.3
typescript 4.8.3

Steps to reproduce

Save the following code to a file:

import { ListObjectsCommand, S3Client } from 'https://deno.land/x/aws_sdk@v3.32.0-1/client-s3/mod.ts';
const client = new S3Client({ region: Deno.env.get('AWS_REGION') || 'eu-west-1' });
const response = await client.send(new ListObjectsCommand({ Bucket: 'test', Prefix: '123', Delimiter: '/abc/' }));
console.log(response.Contents);

Run the following to create the bundle:

deno bundle file-you-just-made.ts mod.test.ts

Then try to use it:

 deno run -A mod.test.ts      

Observed behavior

Depending on the script being used I've seen a range of errors - for the simple script above I get:

error: Uncaught SyntaxError: Identifier 'toNumber' has already been declared
const toNumber = _strnum;

I have also seen:

error: Uncaught SyntaxError: Identifier 'ValidationError' has already been declared
class ValidationError extends CommandError {

Expected behavior

The bundled script should work

Additional context

@ghost ghost added the bug Something isn't working label Dec 9, 2022
@christophgysin
Copy link
Owner

I'm afraid this project is pretty much on hold until there is a workaround for #28.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant