{"id":19589640,"url":"https://github.com/flolu/rules-js-default-import","last_synced_at":"2026-04-15T15:35:55.476Z","repository":{"id":119944431,"uuid":"572438421","full_name":"flolu/rules-js-default-import","owner":"flolu","description":"rules_js default import broken","archived":false,"fork":false,"pushed_at":"2022-11-30T09:22:49.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-09T06:28:28.347Z","etag":null,"topics":["bazel","default-import","javascript","no-interop","rules-js","rules-ts","swc","typescript"],"latest_commit_sha":null,"homepage":"TypeError: (0 , module(...).default) is not a function","language":"Starlark","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flolu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-30T09:22:27.000Z","updated_at":"2022-11-30T09:23:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"4eadd698-ad8d-4762-8075-e7dcd4733173","html_url":"https://github.com/flolu/rules-js-default-import","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flolu%2Frules-js-default-import","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flolu%2Frules-js-default-import/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flolu%2Frules-js-default-import/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flolu%2Frules-js-default-import/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flolu","download_url":"https://codeload.github.com/flolu/rules-js-default-import/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240860451,"owners_count":19869335,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bazel","default-import","javascript","no-interop","rules-js","rules-ts","swc","typescript"],"created_at":"2024-11-11T08:20:01.774Z","updated_at":"2026-04-15T15:35:55.437Z","avatar_url":"https://github.com/flolu.png","language":"Starlark","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003erules_js default import broken\u003c/h1\u003e\n  \u003cp\u003eTypeError: (0 , _sanitizeHtml(...).default) is not a function\u003c/p\u003e\n\u003c/div\u003e\n\n# Solution\n\nThe solution was rather simple. Setting `\"noInterop\": true` in `.swccrc` caused this error. Hence just omitting it or setting it to `false` fixes the issue. Read more about it here: https://swc.rs/docs/configuration/modules#commonjs\n\n# Reproduction\n\n**Requirements**\n\n- Node.js\n- pnpm (`npm install -g pnpm`)\n- Bazelisk (`npm install -g @bazel/bazelisk`)\n\n**Setup**\n\n- `pnpm i` (Install Node dependencies)\n\n**Error**\n\n- `bazelisk run //:bin` (Run app)\n\n  ```\n  INFO: Build completed successfully, 1 total action\n  INFO: Running command line: bazel-bin/bin.sh\n  /home/flolu/.cache/bazel/_bazel_flolu/1b8803ef8961710fdd5d7b63a7d56904/execroot/__main__/bazel-out/k8-fastbuild/bin/bin.sh.runfiles/__main__/main.js:10\n  console.log((0, _sanitizeHtml().default)(html));\n                                          ^\n\n  TypeError: (0 , _sanitizeHtml(...).default) is not a function\n      at Object.\u003canonymous\u003e (/home/flolu/.cache/bazel/_bazel_flolu/1b8803ef8961710fdd5d7b63a7d56904/execroot/__main__/bazel-out/k8-fastbuild/bin/bin.sh.runfiles/__main__/main.js:10:41)\n      at Module._compile (node:internal/modules/cjs/loader:1101:14)\n      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)\n      at Module.load (node:internal/modules/cjs/loader:981:32)\n      at Function.Module._load (node:internal/modules/cjs/loader:822:12)\n      at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)\n      at node:internal/main/run_main_module:17:47\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflolu%2Frules-js-default-import","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflolu%2Frules-js-default-import","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflolu%2Frules-js-default-import/lists"}