{"id":16698182,"url":"https://github.com/arlac77/universal-user-agent-bundler-problems","last_synced_at":"2025-03-14T03:45:35.525Z","repository":{"id":40377565,"uuid":"210426576","full_name":"arlac77/universal-user-agent-bundler-problems","owner":"arlac77","description":"showcase problematic bundling nodes / browser","archived":false,"fork":false,"pushed_at":"2022-05-11T23:32:03.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-12T04:35:34.835Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/arlac77.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}},"created_at":"2019-09-23T18:37:33.000Z","updated_at":"2022-05-11T23:32:07.000Z","dependencies_parsed_at":"2022-08-09T18:50:52.337Z","dependency_job_id":null,"html_url":"https://github.com/arlac77/universal-user-agent-bundler-problems","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/arlac77%2Funiversal-user-agent-bundler-problems","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arlac77%2Funiversal-user-agent-bundler-problems/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arlac77%2Funiversal-user-agent-bundler-problems/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arlac77%2Funiversal-user-agent-bundler-problems/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arlac77","download_url":"https://codeload.github.com/arlac77/universal-user-agent-bundler-problems/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243521257,"owners_count":20304186,"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":[],"created_at":"2024-10-12T17:51:04.652Z","updated_at":"2025-03-14T03:45:35.502Z","avatar_url":"https://github.com/arlac77.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n```sh\nnode dist/bundeled-with-rollup-cjs-not-working\n```\n\n```\n/Users/markus/build/universal-user-agent-bundler-problems/dist/bundeled-with-rollup-cjs-not-working:4\n    return navigator.userAgent;\n    ^\n\nReferenceError: navigator is not defined\n    at getUserAgent (/Users/markus/build/universal-user-agent-bundler-problems/dist/bundeled-with-rollup-cjs-not-working:4:5)\n    at Object.\u003canonymous\u003e (/Users/markus/build/universal-user-agent-bundler-problems/dist/bundeled-with-rollup-cjs-not-working:7:13)\n    at Module._compile (internal/modules/cjs/loader.js:936:30)\n    at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)\n    at Module.load (internal/modules/cjs/loader.js:790:32)\n    at Function.Module._load (internal/modules/cjs/loader.js:703:12)\n    at Function.Module.runMain (internal/modules/cjs/loader.js:999:10)\n    at internal/main/run_main_module.js:17:11\n```\n\n\n\n```sh\nnode dist/bundeled-with-rollup-cjs-external-workaround\n```\n\n```\nNode.js/12.10.0 (macOS Mojave; x64)\n```\n\nafter patchin with (and rollup rerun)\n```\n./patch-univeral-user-agent.mjs\n```\n\n```sh\nnode dist/bundeled-with-rollup-cjs-not-working\n```\n\nis working fine\n```\nmbpMarkus:universal-user-agent-bundler-problems markus$ node dist/bundeled-with-rollup-cjs-not-working \nNode.js/12.11.1 (macOS Mojave; x64)\n```\n\n\n\n\n\ncalling as esm directly without bundler also does not work\n```sh\nnode --experimental-modules index.mjs\n```\n\n```\nimport { getUserAgent } from \"universal-user-agent\";\n         ^^^^^^^^^^^^\nSyntaxError: The requested module 'universal-user-agent' does not provide an export named 'getUserAgent'\n    at ModuleJob._instantiate (internal/modules/esm/module_job.js:93:21)\n    at async ModuleJob.run (internal/modules/esm/module_job.js:108:20)\n    at async Loader.import (internal/modules/esm/loader.js:137:24)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farlac77%2Funiversal-user-agent-bundler-problems","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farlac77%2Funiversal-user-agent-bundler-problems","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farlac77%2Funiversal-user-agent-bundler-problems/lists"}