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

Issue with in-repo-engines (i.e. addons) using pods structure and podModulePrefix #295

Open
AndreJoaquim opened this issue Sep 5, 2018 · 7 comments

Comments

@AndreJoaquim
Copy link

AndreJoaquim commented Sep 5, 2018

After a long talk/debugging session with @webark, we found out that there's an issue using this addon in in-repo-engines that have the pods structure.

The issue is that the file containing the styles and the auto-generated classes exists but the auto-generated class names are not injected in the HTML DOM elements.

Below, I leave my in-repo-engine structure and the config/environment.js file (including the podModulePrefix)

in-repo-engine (neighborhood-page) structure
screen shot 2018-09-05 at 18 33 38

// lib/neighborhood-page/config/environment.js
/* eslint-env node */
'use strict';

module.exports = function(environment) {
  let ENV = {
    podModulePrefix: 'neighborhood-page/pods',
    modulePrefix: 'neighborhood-page',
    environment
  };

  return ENV;
};

@webark was really helpful and I'll post some of the results of our debugging:

Q1: See if the components you are expecting are in this.. window.requirejs.entries['ember-component-css/pod-names'].module.exports.default
A1:
screen shot 2018-09-05 at 17 57 30

Q2: Run find . -name "pod-names.js" -path "*/addon/*" in your root, and see how many files get outputted
A2: the console outputs the following: ./node_modules/ember-component-css/addon/pod-names.js

Q3: What's the path of that component in the addon directory? What's the path in the app directory? How are you calling it from the template? In the addon componet.js file you are manually setting the layout right?
Q3: /addon/np-description/component.js; /lib/neighborhood-page/addon/np-description/component.js; lib/neighborhood-page/addon/pods/index/template.hbs -> {{np-description neighborhoodPage=model.neighborhoodPage}}; Yes.

Q4: By taking off the podModulePrefix and putting all the pods under /addon (i.e. moving all the folders from /addon/pods to /addon) does it work?
Q4: Yes, it works

Last considerations: @webark, thanks so much for your help, you're super awesome!
Just wanted to say that this addon is freaking awesome and I use it in all of our platforms 🙂
It’s so awesome that it was the first thing I added to my first in-repo-engine 😄

@AndreJoaquim AndreJoaquim changed the title Issue with in-repo-engines (i.e. addons) using pods structure Issue with in-repo-engines (i.e. addons) using pods structure and podModulePrefix Sep 6, 2018
@dguettler
Copy link

I seem to have similar issue, but with components belonging to the main application.
Styles are in the final app.css file, but the corresponding name is missing from the rendered component class.

@webark
Copy link
Owner

webark commented Sep 14, 2018

@dguettler hmm.. are these route styles? or component styles..

@peiris
Copy link

peiris commented Apr 18, 2019

@AndreJoaquim Were you able to fix this issue? I'm having a similar issue.

@AndreJoaquim
Copy link
Author

@peiris Nope :(

@webark
Copy link
Owner

webark commented May 14, 2019

Are you reexporting in the “app” space in a pod or classic structure?

@webark
Copy link
Owner

webark commented May 14, 2019

and i’d leave off the prefix in the structure inside of the “addon” space.

@webark
Copy link
Owner

webark commented May 14, 2019

but i thought i had fixed this. :(

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

4 participants