jorgerosal / amazon-paapi

🔥Amazon Product Advertising API for NodeJs. A PAAPI 5.0 sdk wrapper.
https://webservices.amazon.com/paapi5/documentation/
MIT License
76 stars 19 forks source link

Module not found: Can't resolve 'ApiClient' #25

Open KashyapAmanSingh opened 7 months ago

KashyapAmanSingh commented 7 months ago

./node_modules/amazon-paapi/SDK/src/index.js Module not found: Can't resolve 'ApiClient' Did you mean './ApiClient'? Requests that should resolve in the current directory need to start with './'. Requests that start with a name are treated as module requests and resolve within module directories (node_modules, C:\Users\arbal\OneDrive\Desktop\iitm\shopping-web-app). If changing the source code is not an option there is also a resolve options called 'preferRelative' which tries to resolve these kind of requests in the current directory too.

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module: ./node_modules/amazon-paapi/app.js ./src/app/api/amazonData/route.tsx

these are my codes

const amazonPaapi = require('amazon-paapi');

try { const data = await amazonPaapi.SearchItems(commonParameters, requestParameters);

console.log(data);

} catch (error) { // catch an error. console.log(error); }

hypericon commented 6 months ago

same issue migrating to a react component. any chance we can address this?

city17 commented 6 months ago

@KashyapAmanSingh @hypericon Did you end up finding a solution to this? Running into the same problem.

hypericon commented 6 months ago

Unfortunately I had do switch to PHP: for sure is a problem connected to how the headers are created and sent.The other issue is it’s hard to debug wether the request is well formatted before you create the call to the API :(Il giorno 22 mar 2024, alle ore 12:21, Robbert @.***> ha scritto: @KashyapAmanSingh @hypericon Did you end up finding a solution to this? Running into the same problem.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

city17 commented 6 months ago

Unfortunately I had do switch to PHP: for sure is a problem connected to how the headers are created and sent.The other issue is it’s hard to debug wether the request is well formatted before you create the call to the API :(Il giorno 22 mar 2024, alle ore 12:21, Robbert @.> ha scritto: @KashyapAmanSingh @hypericon Did you end up finding a solution to this? Running into the same problem. —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.>

Thanks. Do you think this is a problem with this specific package or the Amazon NodeJS SDK in general?

hypericon commented 6 months ago

In my case I am quite sure the porting from JAVA or PHP to typescript and react even if code-correct, have some problem in the headers. Since the PHP library have worked instantly… So I believe is connected to my code, not to the PAAPI...

Il giorno 22 mar 2024, alle ore 13:12, Robbert @.***> ha scritto:

Unfortunately I had do switch to PHP: for sure is a problem connected to how the headers are created and sent.The other issue is it’s hard to debug wether the request is well formatted before you create the call to the API :(Il giorno 22 mar 2024, alle ore 12:21, Robbert @.> ha scritto: @KashyapAmanSingh https://github.com/KashyapAmanSingh @hypericon https://github.com/hypericon Did you end up finding a solution to this? Running into the same problem. —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.>

Thanks. Do you think this is a problem with this specific package or the Amazon NodeJS SDK in general?

— Reply to this email directly, view it on GitHub https://github.com/jorgerosal/amazon-paapi/issues/25#issuecomment-2014948538, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABB6M5BLJWXT4CAVOHZG7X3YZQNZNAVCNFSM6AAAAABDB2GLNSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJUHE2DQNJTHA. You are receiving this because you were mentioned.