Closed EssDevUi closed 1 year ago
Hi @EssDevUi ,
"aws-sdk": "^2.1459.0"
is the JS SDK v2 and is not meant to work with packages from @smithy
, for that you need to use the JS SDK v3 imports which should look like @aws-sdk/<package>
So yarn install @aws-sdk/client-s3
or whichever package you need.
Let me know if this helps. Thanks, Ran~
No bro it doesn't work when i Install the package and start the project the issue is same in the console let me post a screenshot so you will get to know what i mean
when i did yarn start it doesn't start the project and throw this error @RanVaknin
and smithy packages are installed by default when we install the aws sdk. it is not getting used anywhere on the frontend but still i'm getting this error @RanVaknin I need your help on priority
Special Note: I must have to work with this sdk version I can't upgrade it to latest so please help me to fix this issue
I have exactly the same issue
Failed to compile.
./node_modules/@smithy/smithy-client/dist-es/default-error-handler.js 11:21
Module parse failed: Unexpected token (11:21)
File was processed with these loaders:
* ./node_modules/react-scripts/node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
| const response = new exceptionCtor({
> name: parsedBody?.code || parsedBody?.Code || errorCode || statusCode || "UnknownError",
| $fault: "client",
| $metadata
I have exactly the same issue
Failed to compile. ./node_modules/@smithy/smithy-client/dist-es/default-error-handler.js 11:21 Module parse failed: Unexpected token (11:21) File was processed with these loaders: * ./node_modules/react-scripts/node_modules/babel-loader/lib/index.js You may need an additional loader to handle the result of these loaders. | const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined; | const response = new exceptionCtor({ > name: parsedBody?.code || parsedBody?.Code || errorCode || statusCode || "UnknownError", | $fault: "client", | $metadata
How did you generated this issue did you use my packages ?
No, my packages
"dependencies": {
"@aws-amplify/auth": "^4.3.10",
"@aws-amplify/ui-react": "^1.2.20",
"@aws-sdk/client-appsync": "^3.36.1",
"@awsui/collection-hooks": "^1.0.21",
"@awsui/components-react": "^3.0.307",
"@craco/craco": "^6.4.5",
"@faker-js/faker": "^8.0.2",
"@tanstack/match-sorter-utils": "^8.8.4",
"@tanstack/react-table": "^8.9.11",
"aws-amplify": "^4.3.4",
"aws-appsync": "^4.1.2",
"axios": "^0.24.0",
"formik": "^2.2.9",
"graphql-tag": "^2.12.5",
"jest": "26.6.0",
"md5": "^2.3.0",
"moment": "^2.29.4",
"react": "^17.0.2",
"react-apollo": "^3.1.5",
"react-csv-reader": "^3.4.0",
"react-dom": "^17.0.2",
"react-icons": "^4.4.0",
"react-json-table-v2": "^0.1.9",
"react-redux": "^7.2.5",
"react-router-dom": "^5.3.0",
"react-scripts": "4.0.3",
"react-toastify": "^8.0.8",
"redux": "^4.1.1",
"redux-saga": "^1.1.3",
"reselect": "^4.0.0",
"yup": "^0.32.11"
},
This is an old project and im trying to run it after some time
@EssDevUi i updated https://www.npmjs.com/package/react-scripts and now it works
@EssDevUi i updated https://www.npmjs.com/package/react-scripts and now it works
Only one package ?
@EssDevUi i updated https://www.npmjs.com/package/react-scripts and now it works
Only one package ?
yes
@EssDevUi i updated https://www.npmjs.com/package/react-scripts and now it works
Only one package ?
yes
which node version you are using ?
I tried on 16 and 18 and it works well
I tried on 16 and 18 and it works well
I'm also using both version using NVM but let me update the script i'll let you know in a while
I tried on 16 and 18 and it works well
I tried the issue gone but now
ERROR in ./node_modules/dotenv/lib/main.js 3:11-24
Module not found: Error: Can't resolve 'os' in 'E:\projects\stella\frontend\node_modules\dotenv\lib'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "os": require.resolve("os-browserify/browser") }'
- install 'os-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "os": false }
ERROR in ./node_modules/dotenv/lib/main.js 4:15-32
Module not found: Error: Can't resolve 'crypto' in 'E:\projects\stella\frontend\node_modules\dotenv\lib'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "crypto": require.resolve("crypto-browserify") }'
- install 'crypto-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "crypto": false }
webpack compiled with 2 errors and 24 warnings
Hi @EssDevUi ,
Im glad you got the first error to resolve.
The second error is self explanatory and is unrelated to the AWS SDK. Webpack 5 no longer automatically includes polyfills for Node.js core modules like os
and crypto
. So when you upgraded from Webpack 4 to Webpack 5, these automatic polyfills were removed, causing the error you are seeing.
You need to update your webpack.config
with the necessary fallbacks.
Please see this stackoverflow thread.
Thanks, Ran~
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.
Checkboxes for prior research
Describe the bug
I've Installed the packages using yarn and when installation is completed . I do yarn start and it's just keep throwing this error
./node_modules/@smithy/smithy-client/dist-es/default-error-handler.js 11:21 Module parse failed: Unexpected token (11:21) File was processed with these loaders:
| const response = new exceptionCtor({
SDK version number
"aws-sdk": "^2.1459.0",
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
18.17.1
Reproduction Steps
just add the following packags :
Observed Behavior
when all packages are installed it should work properly but it's throwing errors or additional loaders i'm using typscript here is tsconfig
Expected Behavior
everything should work my node version is 18.17.1 and i use nvm so i've another 16.16.0 but package error is same on both versions
Possible Solution
No response
Additional Information/Context
No response