Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to import in v13.9.0+ due to default export condition order #815

Closed
twgraham opened this issue Feb 17, 2021 · 2 comments
Closed

Unable to import in v13.9.0+ due to default export condition order #815

twgraham opened this issue Feb 17, 2021 · 2 comments

Comments

@twgraham
Copy link

twgraham commented Feb 17, 2021

Ever since version 13.9.0, my project refuses to build in webpack when I try import compromise. I get the following ambiguous message:
Module not found: Error: Default condition should be last one

The stack trace was pretty useless, so I needed to track down the issue manually. It seems that webpack does not like the default export condition order.

compromise/package.json

Lines 12 to 21 in bd7929c

"exports": {
".": {
"default": "./builds/compromise.js",
"require": "./builds/compromise.js",
"import": "./builds/compromise.mjs"
},
"./tokenize": {
"require": "./builds/compromise-tokenize.js"
}
},

According to webpack, the default case should be last... beats me 🤷‍♂️

If i change the export group so that default is last like so, webpack is happy...

"exports": {
    ".": {
      "require": "./builds/compromise.js",
      "import": "./builds/compromise.mjs",
      "default": "./builds/compromise.js"
    }
}
@spencermountain
Copy link
Owner

oh my gosh, thank you.
will fix this today.

@spencermountain
Copy link
Owner

released as 13.9.3 - thank you for the heads-up!
if you see anything else, pls let me know. Webpack is a journey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants