-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fix moduleNameMapper to not resolve .wasm.js
to .wasm
#9894
Conversation
Fixes misskey-dev#9767 Undici [tries to import `./llhttp/llhttp.wasm.js`](https://github.com/nodejs/undici/blob/e155c6db5cec9bc577d548fa7c7378013631c79c/lib/client.js#L342) which is currently broken by the (hacky) module name mapper.
.wasm.js
to .js
.wasm.js
to .wasm
Codecov Report
@@ Coverage Diff @@
## develop #9894 +/- ##
===========================================
+ Coverage 22.53% 22.87% +0.34%
===========================================
Files 735 729 -6
Lines 68917 67998 -919
Branches 2022 2070 +48
===========================================
+ Hits 15527 15557 +30
+ Misses 53390 52441 -949
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
This reverts commit f3e0f57.
This reverts commit 29214bd.
ローカルではこれでいけるのになんででしょう。ELIFECYCLEの謎。 #9767 の警告自体はこれで解決できるから、あれはまた別のPRで考えてみましょう。 |
This reverts commit fcf8c68.
@@ -85,7 +84,8 @@ class LdSignature { | |||
@bindThis | |||
public async normalize(data: any) { | |||
const customLoader = this.getLoader(); | |||
return await jsonld.normalize(data, { | |||
// XXX: Importing jsonld dynamically since Jest frequently fails to import it statically |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
諦めた結果こうなってしまいました
なんかjsonldのdependencyである@digitalbazaar/http-client/dist/cjs/index.cjs
のdynamic importあたりでなにかエラーが出てくるみたいですが、原因不明です。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jestjs/jest#10620 (comment) 関係あるかもです、ないかもです
When I call it with a valid filepath, Jest exits with a non-zero exit code without reporting any failure (I would expect it to throw "Ok 2").
まさにその通り
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
そもそもCJSとかあるnodeが悪い、denoにするべき💢
🙏🏻🙏🏻🙏🏻 |
What
*.wasm.js
so that the existing rule won't change its path. Also added comments.*.wasm.js
のpathを変えないようにルールを追加しました。コメントも書きました。Why
Undici tries to import
./llhttp/llhttp.wasm.js
which is currently broken by the (hacky)moduleNameMapper
.Undiciの
./llhttp/llhttp.wasm.js
importをmoduleNameMapper
が邪魔しています。Additional info (optional)
Fixes #9767