{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/11438","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/11438/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/11438/comments","events_url":"https://api.github.com/repos/angular/angular/issues/11438/events","html_url":"https://github.com/angular/angular/issues/11438","id":175725420,"number":11438,"title":"Unexpected value 'MyCustomModule' imported by the module 'AppModule'","user":{"login":"rbaumi","id":16101090,"avatar_url":"https://avatars.githubusercontent.com/u/16101090?v=3","gravatar_id":"","url":"https://api.github.com/users/rbaumi","html_url":"https://github.com/rbaumi","followers_url":"https://api.github.com/users/rbaumi/followers","following_url":"https://api.github.com/users/rbaumi/following{/other_user}","gists_url":"https://api.github.com/users/rbaumi/gists{/gist_id}","starred_url":"https://api.github.com/users/rbaumi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbaumi/subscriptions","organizations_url":"https://api.github.com/users/rbaumi/orgs","repos_url":"https://api.github.com/users/rbaumi/repos","events_url":"https://api.github.com/users/rbaumi/events{/privacy}","received_events_url":"https://api.github.com/users/rbaumi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-09-08T11:03:25Z","updated_at":"2016-09-11T21:13:37Z","closed_at":"2016-09-08T12:06:46Z","body":"I am trying to migrate one of my angular2 custom library to RC.6 + Webpack. My directory structure is:\r\n\r\n```\r\n- src - source TS files\r\n- lib - transpiled JS files + definition files\r\n- dev - development app to test if it works / looks ok.\r\n- myCustomLib.js - barrel\r\n- myCustomLib.d.ts\r\n```\r\nWithin `dev` folder try to run an app. I bootstrap my module:\r\n\r\n**app.module.ts**\r\n\r\n```\r\nimport { BrowserModule }                from \"@angular/platform-browser\";\r\nimport { NgModule }                     from \"@angular/core\";\r\nimport { AppComponent }                 from \"./app.component\";\r\nimport { MyCustomModule }               from \"../../myCustomLib\";\r\n\r\n@NgModule({\r\n    imports: [\r\n        BrowserModule,\r\n        MyCustomModule\r\n    ],\r\n    declarations: [ AppComponent ],\r\n    bootstrap: [ AppComponent ]\r\n})\r\nexport class AppModule {\r\n}\r\n```\r\nNow using the webpack I bundle my dev app.\r\n\r\n**webpack.config.js**\r\n\r\n```\r\nmodule.exports = {\r\n    entry: \"./app/boot\",\r\n    output: {\r\n        path: __dirname,\r\n        filename: \"./bundle.js\",\r\n    },\r\n    resolve: {\r\n        extensions: ['', '.js', '.ts'],\r\n        modules: [\r\n            'node_modules'\r\n        ]\r\n    },\r\n    devtool: 'source-map',\r\n    module: {\r\n        loaders: [{\r\n            test: /\\.js$/,\r\n            loader: 'babel-loader',\r\n            exclude: /node_modules/\r\n        }, {\r\n            test: /\\.ts$/,\r\n            loader: 'awesome-typescript-loader',\r\n            exclude: /node_modules/\r\n        }]\r\n    },\r\n    watch: true\r\n};\r\n```\r\nBut when I try to load the app I get a message:\r\n\r\n> metadata_resolver.js:230\r\n> Uncaught Error: Unexpected value 'MyCustomModule' imported by the module 'AppModule'\r\n\r\nMy barrel file I import looks like:\r\n\r\nmyCustomLib.js\r\n\r\n`export * from './lib/myCustomLib.module';`\r\nI found also hint on similar topic on github, but changing it to:\r\n\r\n`export { MyCustomModule } from './lib/myCustomLib.module';`\r\ndid not help. I have also tried to import the module from src directory - same error. MyCustomModule should be ok as It was working fine with systemJS before.\r\n\r\n**myCustomLib.module.ts:**\r\n\r\n```\r\nimport { NgModule }                     from '@angular/core';\r\nimport { BrowserModule }                from '@angular/platform-browser';\r\n\r\n@NgModule({\r\n    imports: [\r\n        BrowserModule\r\n    ]\r\n})\r\nexport class MyCustomModule {}\r\n```\r\n\r\nI have tried to debug it and in file ng_module_resolver.js I can see that it end with:\r\n\r\n> ng_module_resolver.js:30\r\n> Uncaught Error: No NgModule metadata found for 'MyCustomModule'\r\n\r\nAny idea what can be the reason of this error? I have seen similar topics here but no answer or hint helped.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/246205036","html_url":"https://github.com/angular/angular/issues/11438#issuecomment-246205036","issue_url":"https://api.github.com/repos/angular/angular/issues/11438","id":246205036,"user":{"login":"rbaumi","id":16101090,"avatar_url":"https://avatars.githubusercontent.com/u/16101090?v=3","gravatar_id":"","url":"https://api.github.com/users/rbaumi","html_url":"https://github.com/rbaumi","followers_url":"https://api.github.com/users/rbaumi/followers","following_url":"https://api.github.com/users/rbaumi/following{/other_user}","gists_url":"https://api.github.com/users/rbaumi/gists{/gist_id}","starred_url":"https://api.github.com/users/rbaumi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbaumi/subscriptions","organizations_url":"https://api.github.com/users/rbaumi/orgs","repos_url":"https://api.github.com/users/rbaumi/repos","events_url":"https://api.github.com/users/rbaumi/events{/privacy}","received_events_url":"https://api.github.com/users/rbaumi/received_events","type":"User","site_admin":false},"created_at":"2016-09-11T21:13:36Z","updated_at":"2016-09-11T21:13:36Z","body":"@moff: that time it was 2.1.0-beta.22."}}
{"actor":{"display_login":"rbaumi"}}