-
Notifications
You must be signed in to change notification settings - Fork 25k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected value 'MyCustomModule' imported by the module 'AppModule' #11438
Comments
Hard to say for sure but it looks like metadata from decorators are lost during transpilation. Not sure why you are trying to use both TS and Babel. If you need help setting your WebPack build you might have a look at the minimal seed project (https://github.com/angular/angular2-seed), try out CLI, consult https://angular.io/docs/ts/latest/guide/webpack.html or use on of the popular starter kits. In any case this is a support question so doesn't belong here. Try one of the support channels instead: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question |
Similar issue here.. @pkozlowski-opensource , really do not think above is useful suggestion... |
What other suggestion would you expect given that we've got no way of reproducing similar issues locally. I would love to help but there are just so many possible setups and its variants that it is next to impossible to suggest anything without debugging your local setup... |
@lw0110: @pkozlowski-opensource sugestion was right. I used seed project (https://github.com/angular/angular2-seed) to create my library and after compilation everything is working ok... I'm not sure yet what is an exact problem but this issue does not belong here. |
@rbaumi what version of Webpack you were using when you got the error? |
@moff: that time it was 2.1.0-beta.22. |
@rbaumi I've got a feedback describing the same issue in one of my repos. According to it it's clear that this problem appeared only after update to RC6 while using Webpack 2. I use Webpack 1 and I don't have that problem - works good. That's why I think that it has something to do with proper Webpack 2 configuration when using RC6. You wrote that you succeeded with angular2-seed - it uses Webpack 1, not 2nd version. I know that my post is not helping, but unfortunately I haven't found the solution for that so far. If someone will find it - please share! |
I'm also having the same issue right now |
@Avien I haven't found solution for that so I just use Webpack 1 for now. |
I also use Webpack 1 and I do have this problem angular2-seed does not use Webpack but gulp |
@Avien I don't see Gulp in angular2-seed, but I see Webpack 1.12.9. I don't know why I get this error when I use Webpack 2, but I don't have that issue when I use Webpack 1. |
Yeah sorry I was looking at https://github.com/mgechev/angular2-seed |
Looks like npm link caused the problem #11639 |
I'm getting the error also. Cannot import a custom module into the
|
Someone pointed me to this PR, and I'm passing it along, because it solved the problem for me: angular/angular-cli#2291 in webpack config:
I see in the config above that it's only "node_modules". It seems that it only works if it's a full path. |
@Madd0g it has to be with
cause your node_modules won't be available from PS: but if you have custom webpack compilation process, than probably |
it works in my setup, but the important thing is, have the full path to node_modules there. |
I copied and pasted my module include: and this error disappeared. It appears that case does have a major impact here. |
I have same problem, but it is appeared with AotPlugin only. When I built debug version via awesome-typescript-loader I've got success. But I want AotPlugin |
So many closed issues and I not found solution. It is very bad. Angular is bearded dinosaur.... Tricks here and there.... |
open app.component.ts file and import your customModule (e.g. Test_Provider).
and in the component section add it to providers array.
|
I am unable to resolve the issue, tried all the above steps mentioned. do we have any suggestion @Madd0g @zeeshananjumjunaidi @gorshkov-leonid |
I had the same issue and finally found it .. my module imported a dependency that again imported |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I am trying to migrate one of my angular2 custom library to RC.6 + Webpack. My directory structure is:
Within
dev
folder try to run an app. I bootstrap my module:app.module.ts
Now using the webpack I bundle my dev app.
webpack.config.js
But when I try to load the app I get a message:
My barrel file I import looks like:
myCustomLib.js
export * from './lib/myCustomLib.module';
I found also hint on similar topic on github, but changing it to:
export { MyCustomModule } from './lib/myCustomLib.module';
did 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.
myCustomLib.module.ts:
I have tried to debug it and in file ng_module_resolver.js I can see that it end with:
Any idea what can be the reason of this error? I have seen similar topics here but no answer or hint helped.
The text was updated successfully, but these errors were encountered: