Error: Cannot find module './quicksight-2018-04-01.min.json'

Hello, I am trying to embed the Q Search bar and following the steps from the documentation to grab the embed URL through a Node app. I am confident my credentials work because I tested them in another Node app but I keep getting the error in the title and can’t find any help to try anything new. Here is my code in the app:

const AWS = require(‘aws-sdk’);
const https = require(‘https’);

var quicksightClient = new AWS.Service({
apiConfig: require(‘./quicksight-2018-04-01.min.json’),
region: ‘eu-west-2’,
});

quicksightClient.generateEmbedUrlForRegisteredUser({
‘AwsAccountId’: ‘03XXXXXXXXX’,
‘ExperienceConfiguration’: {
‘QSearchBar’: {
‘InitialTopicId’: ‘my_topic_id’
}
},
‘UserArn’: ‘my_arn’,
‘AllowedDomains’: allowedDomains,
‘SessionLifetimeInMinutes’: 100
}, function(err, data) {
console.log('Errors: ');
console.log(err);
console.log('Response: ');
console.log(data);
});

Link to steps: Step 2: Generate the URL with the authentication code attached - Amazon QuickSight

I would be really grateful if anyone has anything else I could try to embed the Q Search Bar.

Thank you in advance…

Hello @richardhamlyn, welcome to the QuickSight Community!

I apologize, I am going to ask a fairly basic question first, but I want to make sure the easy options are out of the way. Have you enabled the Q feature on your QuickSight account? When you look at the Topic section in your QuickSight console, is it showing the option to “Start a free trial” or “Try Q”? I am wondering if the API request isn’t allowing you to actually approve Q onto the account and if that needs to be done manually.

If it isn’t that, we can try to dig into the details of this issue and figure out what is going on. Thank you!

1 Like

Hi @richardhamlyn,
Are you still facing the issue in your code? Please refer to this documentation for node.js, and can you confirm you have step 1 done?

  1. Set up your node environment using the following commands:
    npm install aws-sdk
    npm install aws4
    npm install request
    npm install url

thank you.

2 Likes

Thank you Dylan and Asem. I managed to bypass the issue by moving the quicksight-2018-04-01.min.json file into my node app’s root and referencing it from there. Not sure if there’s an issue with package or something on my end blocked the remote file but this workaround allowed me to move on.

1 Like