Closed adelsz closed 3 years ago
Hi @adelsz, thanks for this. It seems like a good cleanup to do; however, if I run the browser tests (yarn browsertest
) after applying this patch, I get the following error:
15 06 2021 15:08:43.204:ERROR [karma-server]: UncaughtException: Error: Unable to resolve module [automerge] from [/Users/martin/dev/cl/automerge/test/typescript_test.js]
{
"basedir": "/Users/martin/dev/cl/automerge",
"extensions": [
".js",
".json",
".mjs",
".ts",
".tsx"
],
"moduleDirectory": [
"node_modules"
],
"modules": {
"assert": "/Users/martin/dev/cl/automerge/node_modules/assert/build/assert.js",
"buffer": "/Users/martin/dev/cl/automerge/node_modules/buffer/index.js",
"child_process": "/Users/martin/dev/cl/automerge/node_modules/karma-typescript/dist/bundler/resolve/empty.js",
"cluster": "/Users/martin/dev/cl/automerge/node_modules/karma-typescript/dist/bundler/resolve/empty.js",
"console": "/Users/martin/dev/cl/automerge/node_modules/console-browserify/index.js",
"constants": "/Users/martin/dev/cl/automerge/node_modules/constants-browserify/constants.json",
"crypto": "/Users/martin/dev/cl/automerge/node_modules/crypto-browserify/index.js",
"dgram": "/Users/martin/dev/cl/automerge/node_modules/karma-typescript/dist/bundler/resolve/empty.js",
"dns": "/Users/martin/dev/cl/automerge/node_modules/karma-typescript/dist/bundler/resolve/empty.js",
"domain": "/Users/martin/dev/cl/automerge/node_modules/domain-browser/source/index.js",
"events": "/Users/martin/dev/cl/automerge/node_modules/events/events.js",
"fs": "/Users/martin/dev/cl/automerge/node_modules/karma-typescript/dist/bundler/resolve/empty.js",
"http": "/Users/martin/dev/cl/automerge/node_modules/stream-http/index.js",
"https": "/Users/martin/dev/cl/automerge/node_modules/https-browserify/index.js",
"module": "/Users/martin/dev/cl/automerge/node_modules/karma-typescript/dist/bundler/resolve/empty.js",
"net": "/Users/martin/dev/cl/automerge/node_modules/karma-typescript/dist/bundler/resolve/empty.js",
"os": "/Users/martin/dev/cl/automerge/node_modules/os-browserify/browser.js",
"path": "/Users/martin/dev/cl/automerge/node_modules/path-browserify/index.js",
"punycode": "/Users/martin/dev/cl/automerge/node_modules/punycode/punycode.js",
"querystring": "/Users/martin/dev/cl/automerge/node_modules/querystring-es3/index.js",
"readline": "/Users/martin/dev/cl/automerge/node_modules/karma-typescript/dist/bundler/resolve/empty.js",
"repl": "/Users/martin/dev/cl/automerge/node_modules/karma-typescript/dist/bundler/resolve/empty.js",
"stream": "/Users/martin/dev/cl/automerge/node_modules/stream-browserify/index.js",
"_stream_duplex": "/Users/martin/dev/cl/automerge/node_modules/karma-typescript/node_modules/readable-stream/lib/_stream_duplex.js",
"_stream_passthrough": "/Users/martin/dev/cl/automerge/node_modules/karma-typescript/node_modules/readable-stream/lib/_stream_passthrough.js",
"_stream_readable": "/Users/martin/dev/cl/automerge/node_modules/karma-typescript/node_modules/readable-stream/lib/_stream_readable.js",
"_stream_transform": "/Users/martin/dev/cl/automerge/node_modules/karma-typescript/node_modules/readable-stream/lib/_stream_transform.js",
"_stream_writable": "/Users/martin/dev/cl/automerge/node_modules/karma-typescript/node_modules/readable-stream/lib/_stream_writable.js",
"string_decoder": "/Users/martin/dev/cl/automerge/node_modules/string_decoder/lib/string_decoder.js",
"sys": "/Users/martin/dev/cl/automerge/node_modules/util/util.js",
"timers": "/Users/martin/dev/cl/automerge/node_modules/timers-browserify/main.js",
"tls": "/Users/martin/dev/cl/automerge/node_modules/karma-typescript/dist/bundler/resolve/empty.js",
"tty": "/Users/martin/dev/cl/automerge/node_modules/tty-browserify/index.js",
"url": "/Users/martin/dev/cl/automerge/node_modules/url/url.js",
"util": "/Users/martin/dev/cl/automerge/node_modules/util/util.js",
"vm": "/Users/martin/dev/cl/automerge/node_modules/vm-browserify/index.js",
"zlib": "/Users/martin/dev/cl/automerge/node_modules/browserify-zlib/lib/index.js",
"_process": "/Users/martin/dev/cl/automerge/node_modules/process/browser.js"
},
"filename": "",
"paths": []
}
Error: Cannot find module 'automerge' from '/Users/martin/dev/cl/automerge/test/typescript_test.js'
at /Users/martin/dev/cl/automerge/node_modules/karma-typescript/dist/bundler/resolve/resolver.js:185:27
at /Users/martin/dev/cl/automerge/node_modules/browser-resolve/index.js:265:24
at /Users/martin/dev/cl/automerge/node_modules/resolve/lib/async.js:139:17
at processDirs (/Users/martin/dev/cl/automerge/node_modules/resolve/lib/async.js:290:39)
at isdir (/Users/martin/dev/cl/automerge/node_modules/resolve/lib/async.js:297:32)
at /Users/martin/dev/cl/automerge/node_modules/resolve/lib/async.js:25:69
at FSReqCallback.oncomplete (node:fs:194:21)
Do you know what might be causing that?
Fixed in 1e111cd
. Looks like karma-typescript
has some problems with tsconfig paths https://github.com/monounity/karma-typescript/issues/261
Excellent, this seems to be working now. Thank you for your help @adelsz!
Deep importing from the
uuid
library is deprecated and breaks some browser builds.