question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ES6 Import doesn't work for me

See original GitHub issue

Hello, 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:closed
  • Created 2 years ago
  • Comments:46

github_iconTop GitHub Comments

2reactions
Rabbitzzccommented, Feb 18, 2022

my bad

2reactions
SettingDustcommented, Feb 5, 2022

@SettingDust I see that your fork is quite far from my current version and you had added a lot of modifications, so they could not be merged easily.

I mean your branch not run into error on my end Edit: Gotcha. Error when building.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found