amazon-paapi icon indicating copy to clipboard operation
amazon-paapi copied to clipboard

Module not found: Can't resolve 'ApiClient'

Open KashyapAmanSingh opened this issue 1 year ago • 5 comments

./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); }

KashyapAmanSingh avatar Feb 09 '24 17:02 KashyapAmanSingh

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

hypericon avatar Mar 01 '24 10:03 hypericon

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

city17 avatar Mar 22 '24 11:03 city17

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: @.***>

hypericon avatar Mar 22 '24 12:03 hypericon

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?

city17 avatar Mar 22 '24 12:03 city17

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.

hypericon avatar Mar 22 '24 15:03 hypericon