Can't import the named export 'RestError' from non EcmaScript module (only default export is available)
See original GitHub issue- 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.git
cd react-app-4
npm i
npm start
Expected behavior Support for ECMA module files.
Additional context
The same problem is observed in @azure/core-client
package too.
Issue Analytics
- State:
- Created a year ago
- Comments:14 (11 by maintainers)
Top Results From Across the Web
Ask Question - Stack Overflow
TypeError: undefined is not an object (evaluating ... Allow 'import x from y' when a module doesn't have a default export.
Read more >Error when importing document attachments - Kentico DevNet
The scheduler feature used only the main domain name and presentation URL of a site when attempting to process scheduled tasks in local...
Read more >21.03 - Teradici
Licensed under the MIT license.export { AzureKeyCredential } from ". ... Provides a default {@link ChainedTokenCredential} configuration for * applications ...
Read more >2019-October.txt - NGINX mailing list
This can be only done when there are no data in SSL buffers, and there is no ... 15 Aug 2019 + Core:...
Read more >US20210373860A1 - Intent compiler - Google Patents
In contrast, a non-secure friendly chat application would use a default transmission ... service.json, exports.json, imports.json, enums.json, classes.json, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@subhod-i I tested the scenario and PR #22804 appears to have addressed the issue. Will continue working on getting it merged.
@davidyuk I added
"type": "module"
in PR #22804. However, the repro project now gives another error as mentioned above. I am still trying to figure out whether there’s anything I can do to fix that.