{"id":16597271,"url":"https://github.com/adrianmcli/nextjs-symlink-bug","last_synced_at":"2025-10-05T09:19:17.942Z","repository":{"id":73736826,"uuid":"108215026","full_name":"adrianmcli/nextjs-symlink-bug","owner":"adrianmcli","description":null,"archived":false,"fork":false,"pushed_at":"2017-10-28T09:56:31.000Z","size":46,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-17T04:44:26.482Z","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/adrianmcli.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":"2017-10-25T03:28:28.000Z","updated_at":"2022-09-06T23:08:49.000Z","dependencies_parsed_at":"2023-04-01T10:33:09.521Z","dependency_job_id":null,"html_url":"https://github.com/adrianmcli/nextjs-symlink-bug","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/adrianmcli%2Fnextjs-symlink-bug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianmcli%2Fnextjs-symlink-bug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianmcli%2Fnextjs-symlink-bug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianmcli%2Fnextjs-symlink-bug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adrianmcli","download_url":"https://codeload.github.com/adrianmcli/nextjs-symlink-bug/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242274708,"owners_count":20101091,"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-11T23:55:22.495Z","updated_at":"2025-10-05T09:19:12.899Z","avatar_url":"https://github.com/adrianmcli.png","language":"JavaScript","readme":"# Next.js Symlink Bug Demonstration (solution found!)\n\nNext.js seems to have trouble importing from modules within symlinked folders. In this example repo, I've demonstrated this by putting two folders inside the `lib` directory: `symlink-folder` and `normal-folder`.\n\nInside each of these folders is a near-identical javascript file that exports a simple object. There is only one page, `index.js` that will read from this and display the text.\n\n# Solution\n\nAccording to [this Github issue comment](https://github.com/webpack/webpack/issues/1643#issuecomment-317436595), I needed to set `resolve.symlinks: false` in my webpack configuration. So that's exactly what I did inside `next.config.js`:\n\n```js\nmodule.exports = {\n  webpack: (config, { buildId, dev }) =\u003e {\n    config.resolve.symlinks = false\n    return config\n  }\n}\n```\n\nAnd now it works.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrianmcli%2Fnextjs-symlink-bug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadrianmcli%2Fnextjs-symlink-bug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrianmcli%2Fnextjs-symlink-bug/lists"}