Skip to content

Not able to start the application #3

@amit-gayal

Description

@amit-gayal

I am using Node v20. I am following these instructions to create a simple application.

When I start the application, it runs into below error.

(node:33917) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
/Users/someuser/Documents/VS Code Local Directory/ACAgentDesktopApp/app.js:1
import { AmazonConnectApp } from "@amazon-connect/app";

After setting "type": "module" in the package.json file, the error changes to below:

file:///Users/someuser/Documents/VS%20Code%20Local%20Directory/ACAgentDesktopApp/app.js:1
import { AmazonConnectApp } from "@amazon-connect/app";
         ^^^^^^^^^^^^^^^^
SyntaxError: Named export 'AmazonConnectApp' not found. The requested module '@amazon-connect/app' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@amazon-connect/app';
const { AmazonConnectApp } = pkg;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions