azure-sdk-for-js: Can't import the named export 'RestError' from non EcmaScript module (only default export is available)

Describe the bug Trying to perform import { RestError } from '@azure/core-rest-pipeline'; in a ECMAScript Module file (.mjs).

returns build error with the message Can't import the named export 'RestError' from non EcmaScript module (only default export is available)

To Reproduce Steps to reproduce the behavior: I have created a simple project to demonstrate this

  1. git clone git@github.com:subhod-i/react-app-4.git
  2. cd react-app-4
  3. npm i
  4. npm start

Expected behavior Support for ECMA module files.

Additional context The same problem is observed in @azure/core-client package too.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (11 by maintainers)

Commits related to this issue

Most upvoted comments

@subhod-i I tested the scenario and PR #22804 appears to have addressed the issue. Will continue working on getting it merged.