-
-
Notifications
You must be signed in to change notification settings - Fork 504
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
2.13 'lib' import errors in Jest #1786
2.13 'lib' import errors in Jest #1786
Comments
Thanks @thewilkybarkid, I think the culprit might be 87455b8, I'll revert that change too |
@thewilkybarkid ok, I reverted the build change in 87455b8, updated the "exports": {
".": {
"require": "./lib/index.js",
"import": "./es6/index.js",
"types": "./lib/index.d.ts"
},
"./HKT": {
"require": "./lib/HKT.js",
"import": "./es6/HKT.js",
"types": "./HKT.d.ts"
},
"./*": {
"require": "./lib/*.js",
"import": "./es6/*.js",
"types": "./lib/*.d.ts"
},
"./es6/HKT": {
"import": "./es6/HKT.js",
"types": "./HKT.d.ts"
},
"./es6/*": {
"import": "./es6/*.js",
"types": "./lib/*.d.ts"
},
"./lib/HKT": {
"require": "./lib/HKT.js",
"types": "./HKT.d.ts"
},
"./lib/*": {
"require": "./lib/*.js",
"types": "./lib/*.d.ts"
}
} ...and released EDIT p.s. |
Thanks for taking a look @gcanti. Unfortunately, I'm still seeing the same problem. I'm trying to debug, but if you'd like to reproduce it clone https://github.com/prereview/prereview.org, run |
Looks like the order of the |
The same tweak worked on |
Ahhh interesting, so "exports": {
".": {
"require": "./lib/index.js",
"import": "./es6/index.js",
"types": "./lib/index.d.ts"
},
"./HKT": {
"require": "./lib/HKT.js",
"import": "./es6/HKT.js",
"types": "./HKT.d.ts"
},
"./es6/HKT": {
"import": "./es6/HKT.js",
"types": "./HKT.d.ts"
},
"./es6/*": {
"import": "./es6/*.js",
"types": "./lib/*.d.ts"
},
"./lib/HKT": {
"require": "./lib/HKT.js",
"types": "./HKT.d.ts"
},
"./lib/*": {
"require": "./lib/*.js",
"types": "./lib/*.d.ts"
},
"./*": {
"require": "./lib/*.js",
"import": "./es6/*.js",
"types": "./lib/*.d.ts"
}
} right? |
@gcanti Yep, it must try matching top to bottom. Edit: confirmed:
|
|
Just tried upgrading a project to
2.13.0-rc.4
to see what happens, and found that the old-stylefp-ts/lib/
imports in io-ts cause Jest to fail:It might happen with other packages too (e.g. logging-ts), but it's probably not reached them yet.
Given the project runs successfully (with Node 16.17.0), this could be a Jest problem (or a problem with our configuration), but I thought it worth flagging here.
The text was updated successfully, but these errors were encountered: