You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the package with Next 13 causing this issue:
`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, /Users/codeclouds-sourabh/Documents/essex/node_modules/.pnpm/next@13.4.8_@babel[email protected][email protected][email protected]/node_modules/next/dist/bin/node_modules, /Users/codeclouds-sourabh/Documents/essex/node_modules/.pnpm/next@13.4.8_@babel[email protected][email protected][email protected]/node_modules/next/dist/node_modules, /Users/codeclouds-sourabh/Documents/essex/node_modules/.pnpm/next@13.4.8_@babel[email protected][email protected][email protected]/node_modules/next/node_modules, /Users/codeclouds-sourabh/Documents/essex/node_modules/.pnpm/next@13.4.8_@babel[email protected][email protected][email protected]/node_modules, /Users/codeclouds-sourabh/Documents/essex/node_modules/.pnpm/node_modules, /Users/codeclouds-sourabh/Documents/essex).
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.
Import trace for requested module:
./app/api/revalidate/route.ts
warn Fast Refresh had to perform a full reload due to a runtime error.`
Code Snippet
import * as cybersourceRestApi from 'cybersource-rest-client'; var instance = new cybersourceRestApi.KeyGenerationApi({ authenticationType: 'http_signature', runEnvironment: 'cybersource.environment.SANDBOX', merchantID, merchantKeyId, merchantsecretKey, keyAlias: 'testrest', keyPass: 'testrest', keyFileName: 'testrest', keysDirectory: 'Resource', enableLog: true, logFilename: 'cybs', logDirectory: '../log', logFileMaxSize: '5242880' }); var request = new cybersourceRestApi.GeneratePublicKeyRequest(); request.encryptionType = 'RsaOaep256'; request.targetOrigin = 'http://localhost:3000'; var opts: { format: any } = { format: 'jwt' }; instance.generatePublicKey(request, opts, function (error: any, data: any, response: any) { if (error) { console.log('Error : ' + error); console.log('Error status code : ' + error.statusCode); } else if (data) { console.log('Data : ' + JSON.stringify(data)); console.log('CaptureContext: ' + data.keyId); } console.log('Response : ' + JSON.stringify(response)); console.log('Response Code Of GenerateKey : ' + response['status']); console.error(error, data); }); }
Do you have any idea how to resolve this issue? Have tried altering the webpack config using next.config.js and that didn't fix anything. Any help is appreciated.
The text was updated successfully, but these errors were encountered:
Any update on this particular issue? I'm running into this issue in Next, and well as simply trying to run the sample node application.
import ApiClient from '../node_modules/cybersource-rest-client/src/ApiClient';
I did find if I import ApiClient directly, it resolves that issue, but then results in another error:
⨯ ./node_modules/cybersource-rest-client/src/ApiClient.js
Module not found: Can't resolve 'Authentication/Authorization'
Using the package with Next 13 causing this issue:
`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, /Users/codeclouds-sourabh/Documents/essex/node_modules/.pnpm/next@13.4.8_@babel[email protected][email protected][email protected]/node_modules/next/dist/bin/node_modules, /Users/codeclouds-sourabh/Documents/essex/node_modules/.pnpm/next@13.4.8_@babel[email protected][email protected][email protected]/node_modules/next/dist/node_modules, /Users/codeclouds-sourabh/Documents/essex/node_modules/.pnpm/next@13.4.8_@babel[email protected][email protected][email protected]/node_modules/next/node_modules, /Users/codeclouds-sourabh/Documents/essex/node_modules/.pnpm/next@13.4.8_@babel[email protected][email protected][email protected]/node_modules, /Users/codeclouds-sourabh/Documents/essex/node_modules/.pnpm/node_modules, /Users/codeclouds-sourabh/Documents/essex).
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:
./app/api/revalidate/route.ts
Code Snippet
import * as cybersourceRestApi from 'cybersource-rest-client';
var instance = new cybersourceRestApi.KeyGenerationApi({ authenticationType: 'http_signature', runEnvironment: 'cybersource.environment.SANDBOX', merchantID, merchantKeyId, merchantsecretKey, keyAlias: 'testrest', keyPass: 'testrest', keyFileName: 'testrest', keysDirectory: 'Resource', enableLog: true, logFilename: 'cybs', logDirectory: '../log', logFileMaxSize: '5242880' }); var request = new cybersourceRestApi.GeneratePublicKeyRequest(); request.encryptionType = 'RsaOaep256'; request.targetOrigin = 'http://localhost:3000'; var opts: { format: any } = { format: 'jwt' }; instance.generatePublicKey(request, opts, function (error: any, data: any, response: any) { if (error) { console.log('Error : ' + error); console.log('Error status code : ' + error.statusCode); } else if (data) { console.log('Data : ' + JSON.stringify(data)); console.log('CaptureContext: ' + data.keyId); } console.log('Response : ' + JSON.stringify(response)); console.log('Response Code Of GenerateKey : ' + response['status']); console.error(error, data); }); }
Do you have any idea how to resolve this issue? Have tried altering the webpack config using next.config.js and that didn't fix anything. Any help is appreciated.
The text was updated successfully, but these errors were encountered: