article-extractor: ES6 Import doesn't work for me
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.
About this issue
- Original URL
 - State: closed
 - Created 3 years ago
 - Comments: 46 (19 by maintainers)
 
Commits related to this issue
- Switch to es6 module format - Related issue: #206 - Problem not resolved: JSDOM --> canvas - Error: Could not resolve "canvas" - Warning: "./xhr-sync-worker.js" should be marked as external for u... — committed to extractus/article-extractor by ndaidong 2 years ago
 - Switch to es6 module format - Related issue: #206 - Problem not resolved: JSDOM --> canvas - Error: Could not resolve "canvas" - Warning: "./xhr-sync-worker.js" should be marked as external for u... — committed to arbitralr/article-parser by ndaidong 2 years ago
 - feat: update string-comparison for https://github.com/ndaidong/article-parser/issues/206#issuecomment-1044385418 — committed to arbitralr/article-parser by SettingDust 2 years ago
 
my bad
I mean your branch not run into error on my end Edit: Gotcha. Error when building.
@SettingDust v6.0.0rc4 has been released. If nothing wrong, we can merge to main branch next week.
@Rabbitzzc thank you so much! I’m worrying you’ve forgot it.
I published the version
1.1.0, please update to this version and try it.@SettingDust v6.0.0rc2 with your fix has been released, I see it works well now.
BTW, yarn not support version like
x.x.xrc1. It’s should bex.x.x-rc1.Weird. It’s can build without any changes. Maybe it is fixed by itself. It’s seems that a “Quantum” lul. I read
string-comparison’s code https://github.com/Rabbitzzc/js-string-comparison/blob/master/lib/index.js. The modules aren’t import withmain/packages/${module}. But what we meetting says it use a dynamic import. But, I noticed that https://github.com/Rabbitzzc/js-string-comparison/commit/8eafa55801b11bf5f5f66fbe46fe4d6a7b07badf. This commit remove the dynamic import part. How dare esbuild build with an older version? Then I try to clear the package andnpm iagain. Well, it’s fine now.Needn’t remove entire module. Just disable the option to change algorithm. Use the default
levenshtein.I’m trying to use rollup for building now