{"id":17439628,"url":"https://github.com/jayphelps/gatsby-dev-ssr-issue","last_synced_at":"2025-09-17T16:33:35.394Z","repository":{"id":145543790,"uuid":"343494793","full_name":"jayphelps/gatsby-dev-ssr-issue","owner":"jayphelps","description":null,"archived":false,"fork":false,"pushed_at":"2021-03-01T17:39:53.000Z","size":361,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-19T17:58:33.116Z","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/jayphelps.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":"2021-03-01T17:09:04.000Z","updated_at":"2021-03-02T01:50:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"ddf529bf-9f6b-44a9-b9f9-61d2a10971ce","html_url":"https://github.com/jayphelps/gatsby-dev-ssr-issue","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/jayphelps%2Fgatsby-dev-ssr-issue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayphelps%2Fgatsby-dev-ssr-issue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayphelps%2Fgatsby-dev-ssr-issue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayphelps%2Fgatsby-dev-ssr-issue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jayphelps","download_url":"https://codeload.github.com/jayphelps/gatsby-dev-ssr-issue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233409609,"owners_count":18672039,"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-17T13:57:40.853Z","updated_at":"2025-09-17T16:33:30.014Z","avatar_url":"https://github.com/jayphelps.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Reproducing in Gatsby app\n\n```shell\nnpm install\nnpm run develop\n```\n\nTo reproduce the issue, edit this [src/pages/index.js](src/pages/index.js) component, then do a full page refresh.\n\n## Source code for @jayphelps/fake-package\n\n```js\nif (globalThis.fakePackageHasBeenImported) {\n  throw new Error(\n    'globalThis.fakePackageHasBeenImported has already been set to true, meaning this module has been duplicated and evaluated more than once within the same JS isolate.',\n  );\n}\n\nglobalThis.fakePackageHasBeenImported = true;\n```\n\n## Comparison of Next.js behavior\n\n```shell\ncd nextjs-app\nnpm install\nnpm run dev\n```\n\nBecause it's helpful to see what others in the community have already done about this problem, I've included a Next.js app that does the same thing, but where the problem does not happen because it only evaluates node_modules once; it does not duplicate them.\n\nNote, however, the problem does happen if your own Next.js app's code has global state, like it does in Gatsby too. That's a much harder problem to solve, and not an issue for me personally right now, just mentioning for clarity.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjayphelps%2Fgatsby-dev-ssr-issue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjayphelps%2Fgatsby-dev-ssr-issue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjayphelps%2Fgatsby-dev-ssr-issue/lists"}