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

Support for ember 2.x? #6

Closed
peterjmag opened this issue Jun 7, 2018 · 4 comments
Closed

Support for ember 2.x? #6

peterjmag opened this issue Jun 7, 2018 · 4 comments

Comments

@peterjmag
Copy link
Contributor

Hi! Does this addon support Ember 2.x? I'm working with an Ember app that's running 2.14.2, and I'm getting the following after installation:

$ ember server
[...]
The Broccoli Plugin: [BroccoliMergeTrees: TreeMerger (vendor & appJS)] failed with:
Error: ENOENT: no such file or directory, open '/Users/peterjmag/git/[project-name]/tmp/source_map_concat-input_base_path-1IIoQwbO.tmp/node_modules/react/umd/react.development.js'

package.json makes me think that it only supports 3.x, but I thought I'd check first before I go through the whole process of upgrading my Ember app! And if not, perhaps I can do some digging and see if I can help contribute compatibility for 2.x. ☺️

@alexlafroscia
Copy link
Owner

Alright, a few things to work through first:

What is your ember-cli version? Directly importing from node_modules is only supported in version 2.15+ of the CLI; if you're running Ember 2.14, I would recon there's a good chance you're on Ember CLI 2.14 as well. You should be able to bump to Ember CLI 2.15 without breaking your application, and compatibility with this addon should be improved.

If you're using Ember CLI 2.15+ already, can you try go into your node_modules directory and make sure that there is a react and react-dom directory in there, and those directories have the expected files in the umd directory? The relevant import code in the addon can be found here as a reference for what files are imported.

If neither of those is the issue, React must have changed their folder structure and the files no longer exist in those locations. In that case, I have a bug to fix!

@peterjmag
Copy link
Contributor Author

Ah cool, I wasn't aware of that change in 2.15 — bumping ember-cli fixed it. Thanks! 👏

I can open a small PR to clarify this in the README, but before I do: is there a way for people using ember-cli 2.14 and below to work around the issue? And if so, is it worth documenting in the README as well?

If neither of those is the issue, React must have changed their folder structure and the files no longer exist in those locations. In that case, I have a bug to fix!

Looks like the folder structure's unchanged. I tested it with 16.2.0, 16.3.2, and 16.4.0.

@alexlafroscia
Copy link
Owner

alexlafroscia commented Jun 8, 2018

Cool, it's just the ember-cli version that's the issue.

If you want to refactor to use something like ember-cli-node-assets instead of directly importing from node_modules that's OK with me, but it wasn't worth it for me to do that work up-front for an experiment like this. Now that the Ember CLI supports this natively, I would rather not use a shim addon and instead just encourage people to get to at least ember-cli 2.15 since there are rarely backwards-incompatible changes that happen there.

Personally, I think that a README warning and setting a peerDependency of ember-cli >= 2.15.0 is good enough. If you do make the PR for the README and can add that peerDependency, that would be super!

@peterjmag
Copy link
Contributor Author

Yep, that makes sense to me. I'll open a PR when I'm back on my work machine tomorrow!

peterjmag added a commit to peterjmag/ember-cli-react that referenced this issue Jun 11, 2018
peterjmag added a commit to peterjmag/ember-cli-react that referenced this issue Jun 11, 2018
peterjmag added a commit to peterjmag/ember-cli-react that referenced this issue Jun 14, 2018
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