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

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

Open
KashyapAmanSingh opened this issue Feb 9, 2024 · 5 comments
Open

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

KashyapAmanSingh opened this issue Feb 9, 2024 · 5 comments

Comments

@KashyapAmanSingh
Copy link

./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
Copy link

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

@city17
Copy link

city17 commented Mar 22, 2024

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

@hypericon
Copy link

hypericon commented Mar 22, 2024 via email

@city17
Copy link

city17 commented Mar 22, 2024

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
Copy link

hypericon commented Mar 22, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants