{"action":"created","issue":{"url":"https://api.github.com/repos/zeit/next.js/issues/3775","repository_url":"https://api.github.com/repos/zeit/next.js","labels_url":"https://api.github.com/repos/zeit/next.js/issues/3775/labels{/name}","comments_url":"https://api.github.com/repos/zeit/next.js/issues/3775/comments","events_url":"https://api.github.com/repos/zeit/next.js/issues/3775/events","html_url":"https://github.com/zeit/next.js/issues/3775","id":296330860,"number":3775,"title":"Dynamic import() fails in next 5.xx","user":{"login":"lkostrowski","id":9268745,"avatar_url":"https://avatars0.githubusercontent.com/u/9268745?v=4","gravatar_id":"","url":"https://api.github.com/users/lkostrowski","html_url":"https://github.com/lkostrowski","followers_url":"https://api.github.com/users/lkostrowski/followers","following_url":"https://api.github.com/users/lkostrowski/following{/other_user}","gists_url":"https://api.github.com/users/lkostrowski/gists{/gist_id}","starred_url":"https://api.github.com/users/lkostrowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lkostrowski/subscriptions","organizations_url":"https://api.github.com/users/lkostrowski/orgs","repos_url":"https://api.github.com/users/lkostrowski/repos","events_url":"https://api.github.com/users/lkostrowski/events{/privacy}","received_events_url":"https://api.github.com/users/lkostrowski/received_events","type":"User","site_admin":false},"labels":[{"id":455907192,"url":"https://api.github.com/repos/zeit/next.js/labels/Type:%20Bug","name":"Type: Bug","color":"ee0701","default":false}],"state":"open","locked":false,"assignee":{"login":"arunoda","id":50838,"avatar_url":"https://avatars1.githubusercontent.com/u/50838?v=4","gravatar_id":"","url":"https://api.github.com/users/arunoda","html_url":"https://github.com/arunoda","followers_url":"https://api.github.com/users/arunoda/followers","following_url":"https://api.github.com/users/arunoda/following{/other_user}","gists_url":"https://api.github.com/users/arunoda/gists{/gist_id}","starred_url":"https://api.github.com/users/arunoda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arunoda/subscriptions","organizations_url":"https://api.github.com/users/arunoda/orgs","repos_url":"https://api.github.com/users/arunoda/repos","events_url":"https://api.github.com/users/arunoda/events{/privacy}","received_events_url":"https://api.github.com/users/arunoda/received_events","type":"User","site_admin":false},"assignees":[{"login":"arunoda","id":50838,"avatar_url":"https://avatars1.githubusercontent.com/u/50838?v=4","gravatar_id":"","url":"https://api.github.com/users/arunoda","html_url":"https://github.com/arunoda","followers_url":"https://api.github.com/users/arunoda/followers","following_url":"https://api.github.com/users/arunoda/following{/other_user}","gists_url":"https://api.github.com/users/arunoda/gists{/gist_id}","starred_url":"https://api.github.com/users/arunoda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arunoda/subscriptions","organizations_url":"https://api.github.com/users/arunoda/orgs","repos_url":"https://api.github.com/users/arunoda/repos","events_url":"https://api.github.com/users/arunoda/events{/privacy}","received_events_url":"https://api.github.com/users/arunoda/received_events","type":"User","site_admin":false}],"milestone":null,"comments":7,"created_at":"2018-02-12T10:45:22Z","updated_at":"2018-02-20T18:17:49Z","closed_at":null,"author_association":"NONE","body":"<!--- Provide a general summary of the issue in the Title above -->\r\nI have been using this piece of code to asynchronously load one of heavy component on my client side. It was working like a charm:\r\n\r\n`\r\nconst DynamicChart = dynamic(\r\n    import('../components/LineChart/LineChart'),\r\n    {\r\n        loading: () => <SectionPlaceholder><Loader /></SectionPlaceholder>,\r\n        ssr: false,\r\n    },\r\n);\r\n`\r\n\r\nSince update to v5.0.0 I get webpack error, but only when I open the parent page from frontend route. When I directly load from server, it get's loaded. When I get it once (from first load) and go back to this page on frontend, it works too.\r\n\r\nThis is the error I get:\r\n![image](https://user-images.githubusercontent.com/9268745/36093000-8e62f87e-0fe9-11e8-9023-cc8f1f391b59.png)\r\n\r\nI tried `import(...).then(...).catch(...)` but none of chains were triggered.\r\n\r\nThe problem is that I can't reproduce it always.\r\n\r\nI'm also using next-routes if that matters\r\n\r\nI assume that problem occurs because of `undefined` part in webpack. Any ideas how to debug the cause?\r\n\r\nMy package dependencies:\r\n\r\n```\r\n \"dependencies\": {\r\n    \"babel-plugin-styled-components\": \"^1.5.0\",\r\n    \"dotenv\": \"^5.0.0\",\r\n    \"dotenv-webpack\": \"^1.5.4\",\r\n    \"enzyme\": \"^3.3.0\",\r\n    \"eslint-plugin-jest\": \"^21.7.0\",\r\n    \"express\": \"^4.16.2\",\r\n    \"glamor\": \"^2.20.40\",\r\n    \"glamorous\": \"^4.11.4\",\r\n    \"htmlescape\": \"^1.1.1\",\r\n    \"isomorphic-fetch\": \"^2.2.1\",\r\n    \"lodash\": \"^4.17.5\",\r\n    \"next\": \"^5.0.0\",\r\n    \"next-redux-wrapper\": \"^1.3.5\",\r\n    \"next-routes\": \"^1.3.0\",\r\n    \"polished\": \"^1.9.2\",\r\n    \"react\": \"^16.2.0\",\r\n    \"react-dom\": \"^16.2.0\",\r\n    \"react-extras\": \"^0.5.0\",\r\n    \"react-icons\": \"^2.2.7\",\r\n    \"react-markdown\": \"^3.2.0\",\r\n    \"react-modal\": \"^3.1.12\",\r\n    \"react-no-ssr\": \"^1.1.0\",\r\n    \"react-redux\": \"^5.0.6\",\r\n    \"react-sizeme\": \"^2.3.6\",\r\n    \"recharts\": \"^1.0.0-beta.10\",\r\n    \"redux\": \"^3.7.2\",\r\n    \"redux-logger\": \"^3.0.6\",\r\n    \"redux-thunk\": \"^2.2.0\",\r\n    \"reselect\": \"^3.0.1\",\r\n    \"socket.io\": \"^2.0.4\",\r\n    \"socket.io-client\": \"^2.0.4\",\r\n    \"yargs\": \"^11.0.0\"\r\n  },\r\n  \"devDependencies\": {\r\n    \"@storybook/addon-actions\": \"^3.3.12\",\r\n    \"@storybook/addon-info\": \"^3.3.12\",\r\n    \"@storybook/addon-links\": \"^3.3.12\",\r\n    \"@storybook/addons\": \"^3.3.12\",\r\n    \"@storybook/react\": \"^3.3.12\",\r\n    \"@types/enzyme\": \"^3.1.8\",\r\n    \"@types/jest\": \"^22.1.1\",\r\n    \"@types/next\": \"^2.4.7\",\r\n    \"@types/node\": \"^9.4.1\",\r\n    \"@types/react\": \"^16.0.36\",\r\n    \"@types/recharts\": \"^1.0.13\",\r\n    \"@types/reselect\": \"^2.2.0\",\r\n    \"@types/socket.io\": \"^1.4.31\",\r\n    \"@types/storybook__react\": \"^3.0.6\",\r\n    \"babel-core\": \"^6.26.0\",\r\n    \"babel-eslint\": \"^7.2.3\",\r\n    \"babel-plugin-recharts\": \"^1.1.1\",\r\n    \"babel-plugin-transform-decorators-legacy\": \"^1.3.4\",\r\n    \"babel-preset-env\": \"^1.6.1\",\r\n    \"babel-preset-es2015\": \"^6.24.1\",\r\n    \"babel-preset-stage-0\": \"^6.24.1\",\r\n    \"babili-webpack-plugin\": \"^0.1.2\",\r\n    \"console-probe\": \"^2.0.4\",\r\n    \"create-component-app\": \"^1.6.2\",\r\n    \"eslint\": \"^4.17.0\",\r\n    \"eslint-config-airbnb\": \"^16.1.0\",\r\n    \"eslint-plugin-babel\": \"^4.1.2\",\r\n    \"eslint-plugin-import\": \"^2.8.0\",\r\n    \"eslint-plugin-jsx-a11y\": \"^6.0.3\",\r\n    \"eslint-plugin-react\": \"^7.6.1\",\r\n    \"eslint-plugin-styled-components-config\": \"0.0.2\",\r\n    \"jest\": \"^22.1.4\",\r\n    \"prop-types\": \"^15.6.0\",\r\n    \"redux-devtools-extension\": \"^2.13.2\",\r\n    \"webpack-bundle-analyzer\": \"^2.10.0\"\r\n  }\r\n```\r\n\r\n- [x] I have searched the [issues](https://github.com/zeit/next.js/issues) of this repository and believe that this is not a duplicate.\r\n\r\n## Expected Behavior\r\nComponent gets loaded every time\r\n\r\n## Current Behavior\r\nSometimes component is not loaded and webpack tries to load something with `undefined` in name\r\n"},"comment":{"url":"https://api.github.com/repos/zeit/next.js/issues/comments/367069156","html_url":"https://github.com/zeit/next.js/issues/3775#issuecomment-367069156","issue_url":"https://api.github.com/repos/zeit/next.js/issues/3775","id":367069156,"user":{"login":"aputinski","id":603528,"avatar_url":"https://avatars2.githubusercontent.com/u/603528?v=4","gravatar_id":"","url":"https://api.github.com/users/aputinski","html_url":"https://github.com/aputinski","followers_url":"https://api.github.com/users/aputinski/followers","following_url":"https://api.github.com/users/aputinski/following{/other_user}","gists_url":"https://api.github.com/users/aputinski/gists{/gist_id}","starred_url":"https://api.github.com/users/aputinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aputinski/subscriptions","organizations_url":"https://api.github.com/users/aputinski/orgs","repos_url":"https://api.github.com/users/aputinski/repos","events_url":"https://api.github.com/users/aputinski/events{/privacy}","received_events_url":"https://api.github.com/users/aputinski/received_events","type":"User","site_admin":false},"created_at":"2018-02-20T18:17:49Z","updated_at":"2018-02-20T18:17:49Z","author_association":"NONE","body":"@arunoda If you can give me a few pointers on where to start, I can take a stab at debugging the issue."}}
{"actor":{"display_login":"aputinski"}}