I am working on an Electron project and I have configured webpack for it. I recently installed s3-sync-client and @aws-sdk/client-s3 using npm, but when I try to run the project, I get the following error in the console:
[0] Module parse failed: Unexpected token (8:41)
[0] You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
[0] | this.maxAttemptsProvider = maxAttemptsProvider;
[0] | this.mode = RETRY_MODES.ADAPTIVE;
[0] > const { rateLimiter } = options ?? {};
[0] | this.rateLimiter = rateLimiter ?? new DefaultRateLimiter();
[0] | this.standardRetryStrategy = new StandardRetryStrategy(maxAttemptsProvider);
[0] @ ./node_modules/@aws-sdk/util-retry/dist-es/index.js 1:0-40 1:0-40
[0] @ ./node_modules/@aws-sdk/middleware-retry/dist-es/delayDecider.js
[0] @ ./node_modules/@aws-sdk/middleware-retry/dist-es/index.js
[0] @ ./node_modules/@aws-sdk/client-s3/dist-es/S3Client.js
[0] @ ./node_modules/@aws-sdk/client-s3/dist-es/index.js
[0] @ ./app/aws/index.js
[0] @ ./app/App.js
[0] @ ./app/main.js
[0] @ multi @babel/polyfill ./app/main.js
[0]
[0] ERROR in ./node_modules/@aws-sdk/middleware-user-agent/dist-es/user-agent-middleware.js 9:30
[0] Module parse failed: Unexpected token (9:30)
[0] You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
[0] | return next(args);
[0] | const { headers } = request;
[0] > const userAgent = context?.userAgent?.map(escapeUserAgent) || [];
[0] | const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent);
[0] | const customUserAgent = options?.customUserAgent?.map(escapeUserAgent) || [];
[0] @ ./node_modules/@aws-sdk/middleware-user-agent/dist-es/index.js 2:0-40 2:0-40
[0] @ ./node_modules/@aws-sdk/client-s3/dist-es/S3Client.js
[0] @ ./node_modules/@aws-sdk/client-s3/dist-es/index.js
[0] @ ./app/aws/index.js
[0] @ ./app/App.js
[0] @ ./app/main.js
[0] @ multi @babel/polyfill ./app/main.js
I have checked my webpack configuration and I have loaders set up for other file types, but it seems that these packages are not being handled correctly. Can anyone help me with this issue?
Here is a link to my repository for reference.
Thanks in advance for any help!
I tried to make the changes in the webpack accordingly. But nothing seems to work.