ES6 Import doesn't work for me
See original GitHub issueHello, very new to Javascript, so apologies if I’m just misunderstanding and this isn’t a bug.
Per the documentation, I ran:
import { extract } from 'article-parser'
This doesn’t work for me. It leads to:
SyntaxError: Named export 'extract' not found. The requested module 'article-parser' is a CommonJS module, which may not support all module.exports as named exports.
Running import main from ‘article-parser’, and then calling main.extract() does work.
Issue Analytics
- State:
- Created 2 years ago
- Comments:46
Top Results From Across the Web
javascript - ES6 imports doesn't work - Stack Overflow
To use ES6 modules, you have to load the script using type="module" - this ensures that browsers that do not understand ES6 modules...
Read more >ES6 Import doesn't work for me · Issue #206 - GitHub
This doesn't work for me. It leads to: SyntaxError: Named export 'extract' not found. The requested module 'article-parser' is a CommonJS module, which...
Read more >[JS] ES6 Import/Export Syntax Not Working - Replit
For example, I'll have this line: import module from './module.js' , but it'll give me a Syntax error. import { module } from...
Read more >The Stupid Mistake I Made With The JavaScript Import Statement
The first time I wrote a code that contains an import statement, I made literary a stupid mistake. Even though I had an...
Read more >How to use an ES6 import in Node.js? - GeeksforGeeks
Node js doesn't support ES6 import directly. If we try to use import for importing modules directly in node js it will throw...
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 FreeTop 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
Top GitHub Comments
my bad
I mean your branch not run into error on my end Edit: Gotcha. Error when building.