Open Kleywalker opened 1 year ago
Works in 1.0.3. Issue can be closed.
@Kleywalker thanks a lot, you saved me a lot of time with this issue 💯
i'm using bun 1.0.18 the issue still persist tho
1314 | var ImagePreloader = function () {
1315 | var proxyImage = function () {
1316 | var canvas = createTag('canvas');
1317 | canvas.width = 1;
1318 | canvas.height = 1;
1319 | var ctx = canvas.getContext('2d');
^
TypeError: canvas.getContext is not a function. (In 'canvas.getContext("2d")', 'canvas.getContext' is undefined)
at ./node_modules/lottie-web/build/player/lottie_light.js:1319:17
at ./node_modules/lottie-web/build/player/lottie_light.js:1322:14
at ./node_modules/lottie-web/build/player/lottie_light.js:1539:12
at ./node_modules/lottie-web/build/player/lottie_light.js:2:83
at ./node_modules/lottie-web/build/player/lottie_light.js:4:102
at ./node_modules/react-lottie-player/dist/LottiePlayerLight.js:3:14
0 pass
1 fail
Ran 1 tests across 1 files. [9.04s]
any idea on how can ignore the TypeError from node_modules?
It looks like happy-dom still doesn't support the Canvas API. https://github.com/capricorn86/happy-dom/issues/241
What version of Bun is running?
1.0.0+822a00c4d508b54f650933a73ca5f4a3af9a7983
What platform is your computer?
Darwin 22.6.0 x86_64 i386
What steps can reproduce the bug?
add file index.test.ts
What is the expected behavior?
The test runs without error
What do you see instead?
bun test v1.0.0 (822a00c4)
index.test.ts: Starting the MongoMemoryServer Instance failed, enable debug log for more information. Error: 159 | @param path The Path to Stat 160 | @throws if the error is not "ENOENT" or "EACCES" 161 | / 162 | function statPath(path) { 163 | return (0, tslib_1.__awaiter)(this, void 0, void 0, function () { 164 | return fs_1.promises.stat(path).catch((err) => { ^ TypeError: Invalid path string: can't be empty code: "ERR_INVALID_ARG_TYPE"
159 | @param path The Path to Stat 160 | @throws if the error is not "ENOENT" or "EACCES" 161 | / 162 | function statPath(path) { 163 | return (0, tslib_1.__awaiter)(this, void 0, void 0, function () { 164 | return fs_1.promises.stat(path).catch((err) => { ^ TypeError: Invalid path string: can't be empty code: "ERR_INVALID_ARG_TYPE"
✗ Test > should get uri [17.72ms]
0 pass 1 fail Ran 1 tests across 1 files. [382.00ms]
Additional information
No response