azure-sdk-for-js: Can't import the named export 'RestError' from non EcmaScript module (only default export is available)
- Package Name: @azure/core-rest-pipeline
- Package Version: 1.8.1
- Operating system: MacOS Mont.
- create-react-app: : 4.0.0
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
git clone git@github.com:subhod-i/react-app-4.gitcd react-app-4npm inpm 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
- [core-rest-pipeline] Add conditional exports (#22804) - Add conditional exports for core-rest-pipeline - Add .js extension to imported source module name - Bump dev dependency Mocha version to v10 ... — committed to Azure/azure-sdk-for-js by jeremymeng 4 years ago
- [core-rest-pipeline] Add conditional exports (#22804) - Add conditional exports for core-rest-pipeline - Add .js extension to imported source module name - Bump dev dependency Mocha version to v10 ... — committed to Azure/azure-sdk-for-js by jeremymeng 4 years ago
@subhod-i I tested the scenario and PR #22804 appears to have addressed the issue. Will continue working on getting it merged.