Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Barrel stopped working after scripts update. #105

Closed
kleeb opened this issue Oct 6, 2016 · 12 comments
Closed

Barrel stopped working after scripts update. #105

kleeb opened this issue Oct 6, 2016 · 12 comments
Labels

Comments

@kleeb
Copy link

kleeb commented Oct 6, 2016

We are using Angular barrel for file imports, and as our project is already quite huge, we cannot totally refactor it.
It stopped working after yesterday's Adam's commit: 556d2e3

and now we are getting:
Error: Module .../ionic/src/app/index.ts does not export ComponentData (imported by .../src/components/module-components/module-component/module-component.ts) at Module.trace (.../node_modules/rollup/dist/rollup.js:7706:29)

when I am switching back to the rollup conf, that contained ngTemplate() plugin, it works again.

@jgw96
Copy link
Contributor

jgw96 commented Oct 6, 2016

Hello, thanks for using Ionic! Could you provide an example of the line that is causing this error?

@brettatoms
Copy link
Contributor

@kleeb s ComponentData an interface? I had the same problem with interfaces that are never implemented getting stripped where I depended on them for type checking.

@kleeb
Copy link
Author

kleeb commented Oct 6, 2016

Yes, ComponentData is an interface, that is put in the barrel.
However when I tried importing it straight, rollup was saying that it hasn't been exported (like when export was missing before interface, but its there). As I wrote, this is not causing the bundle not to build when I am switch back to ngTemplate plugin.

@jgw96
Copy link
Contributor

jgw96 commented Oct 6, 2016

@kleeb Would you mind sharing a repo that we can use to reproduce this issue?

@kleeb
Copy link
Author

kleeb commented Oct 7, 2016

@jgw96 will do my best to reproduce on some smaller piece of code and share it, will get back asap

@Manduro
Copy link
Contributor

Manduro commented Oct 7, 2016

This is the same problem as mentioned by others in #64: interfaces that are used for type checking and are never implemented are removed, throwing an error. This is unrelated to barrels and also happens when importing directly. cc @10freefingers

@kleeb
Copy link
Author

kleeb commented Oct 7, 2016

I cannot reproduce it on smaller project.

From around 100 interfaces only 1 was causing problem.
I just changed it to become a class, and it fixed the issue.

Probably some inheritance and usage of those interfaces in some special way inside template is causing problems.

@rehiy
Copy link

rehiy commented Oct 9, 2016

I had the same problem with interfaces that are never implemented getting stripped where I depended on them for type checking.

@Manduro
Copy link
Contributor

Manduro commented Oct 11, 2016

Interesting update: @masatada mentions in the issue referenced above that it only occurs when using the interface to type an @Input. I can confirm that this is also the case with me.

So @jgw96 you should be able to reproduce this problem now.

I'm setting the erroring @Input types to any for now.

@scunningham777
Copy link

scunningham777 commented Oct 11, 2016

I'm also seeing this with @Inject, so it's probably related to decorators in general.

@kleeb
Copy link
Author

kleeb commented Oct 17, 2016

Look like its fixed with Ionic RC1 + Angular 2.1.0.

@kleeb kleeb closed this as completed Oct 17, 2016
@Manduro
Copy link
Contributor

Manduro commented Oct 17, 2016

Same here!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants