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

Most upvoted comments

my bad

@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.

@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 be x.x.x-rc1.

Note: There are also sometimes “labels” or “extensions” to the semver format that mark things like pre-releases or betas (e.g. 2.0.0-beta.3)

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 with main/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 and npm i again. Well, it’s fine now.

Needn’t remove entire module. Just disable the option to change algorithm. Use the default levenshtein.

@SettingDust if so, rollup may help. Let’s me try with Rollup to see if it works for us.

I’m trying to use rollup for building now