Skip to content

Runtime error in version 3.3.1 #99

Open
@bsrikanth-tby

Description

@bsrikanth-tby

In my angular project after upgrading @mongodb-js/charts-embed-dom to version 3.3.1 code compiles fine but I see this runtime error.

TypeError: _mongodb_js_charts_embed_dom__WEBPACK_IMPORTED_MODULE_0___default(...) is not a constructor

This runtime error is thrown exactly when the below code is run

const sdk = new EmbedSDK({ baseUrl: 'https://charts.mongodb.com' });

I'm using import statement like this in my angular component.

import EmbedSDK from '@mongodb-js/charts-embed-dom';

I'm using ES2022 module system in my tsconfig file. (compilerOptions.module: 'ES2022' and compilerOptions.target: 'ES2022')

image

Note: Just after upgrading to 3.3.1 I got an error mentioned in #98. To fix it I added this to webpack.config.js file.

experiments: {topLevelAwait: true, outputModule: true}, resolve: {fallback: { "crypto": false }}

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