Skip to content
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

Adding files to the resolver #209

Closed
A-Helberg opened this issue Jul 21, 2017 · 3 comments
Closed

Adding files to the resolver #209

A-Helberg opened this issue Jul 21, 2017 · 3 comments

Comments

@A-Helberg
Copy link

Hi Guys,

Don't know if this is the appropriate place to ask, if not, please feel free to close it :)

A copy of https://stackoverflow.com/questions/45233182/ember-addon-and-processing-files

I have successfully managed to render a React component inside of ember.
You can see the relevant code here.

The basics being adding an addon, that uses the preprocessTree hook, to use broccoli-react to parse the jsx files as per here. And a ReactComponent (which is an ember component) to wrap any react component.

This works well in ember cli 2.11.0 and 2.12.0, but in 2.13.0 and 2.14.0 something has changed and I can't figure out what.

I have narrowed the error down to this line in ember-resolver, for some reason this._moduleRegistry in the newer versions don't have the react component but the older versions do...

Any ideas?

@mixonic
Copy link
Member

mixonic commented Jul 24, 2017

@A-Helberg can you confirm this is related to the ember-resolver version, and not to the ember-cli or ember-source version? You mention versions numbers that might apply to ember-cli or ember-source, but that don't apply to this package. You can change the version number of ember-resolver independently of the ember-cli or ember-source version.

At a glance I'm not sure what would have changed to cause your code to fail. A reproduction in an Ember twiddle or in a github repo would perhaps help someone here debug the issue further.

@A-Helberg
Copy link
Author

Hi @mixonic,

Thanks for getting back! I've been banging my head on this one for a while.

I am not familiar enough with the internal workings of ember to be able to figure it out, mostly because I don't know what populates the _moduleRegistry in the resolver. (and I don't really know how to debug the whole build process).

But as an aside I will try and update the resolver version independently of the others and see if it is actually the issue.

In the mean time if someone can or wants to take a look, the repo here has three branches, the 2.12.0 one is a clean ember-cli 2.12.0 app, with just the relevant code, which works and renders "Hello react" on the homepage.
The 2.13.0 branch is the same code, but has the error as mentioned above.

@A-Helberg
Copy link
Author

I'm handing in my development card.
I uninstalled everything node related and reinstalled, started matching package versions 1 for 1, and well, it all works ¯_(ツ)_/¯

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

No branches or pull requests

2 participants