waku-org / js-waku

JavaScript implementation of Waku v2
https://js.waku.org
Apache License 2.0
162 stars 41 forks source link

fix: add .js to base protocol import in filter sdk #2009

Closed adklempner closed 1 month ago

adklempner commented 1 month ago

Problem

Using @waku/sdk fails in browser with this error:

ERROR in ../../../js-waku/packages/sdk/dist/protocols/filter.js 5:0-50
Module not found: Error: Can't resolve './base_protocol' in '/Users/arseniy/Waku/js-waku/packages/sdk/dist/protocols'
Did you mean 'base_protocol.js'?
BREAKING CHANGE: The request './base_protocol' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

Solution

Add `.js` to the failing import ## Notes

Contribution checklist:

github-actions[bot] commented 1 month ago

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
Waku node 181.24 KB (0%) 3.7 s (0%) 1.3 s (-21.83% 🔽) 4.9 s
Waku Simple Light Node 181.32 KB (0%) 3.7 s (0%) 1.3 s (-14.3% 🔽) 4.9 s
ECIES encryption 23.12 KB (0%) 463 ms (0%) 440 ms (+55.08% 🔺) 902 ms
Symmetric encryption 22.53 KB (0%) 451 ms (0%) 573 ms (+9.12% 🔺) 1.1 s
DNS discovery 72.5 KB (0%) 1.5 s (0%) 1.2 s (-13.71% 🔽) 2.6 s
Peer Exchange discovery 74.09 KB (0%) 1.5 s (0%) 1.2 s (+11.07% 🔺) 2.7 s
Local Peer Cache Discovery 67.63 KB (0%) 1.4 s (0%) 678 ms (-43.73% 🔽) 2.1 s
Privacy preserving protocols 38.88 KB (0%) 778 ms (0%) 454 ms (-44.14% 🔽) 1.3 s
Waku Filter 111.72 KB (0%) 2.3 s (0%) 989 ms (-18.61% 🔽) 3.3 s
Waku LightPush 110.26 KB (0%) 2.3 s (0%) 1.2 s (-21.22% 🔽) 3.4 s
History retrieval protocols 110.76 KB (0%) 2.3 s (0%) 1.5 s (+57.92% 🔺) 3.8 s
Deterministic Message Hashing 7.24 KB (0%) 145 ms (0%) 69 ms (-43.43% 🔽) 214 ms