Addepar / ember-table

https://opensource.addepar.com/ember-table/
Other
1.69k stars 351 forks source link

Failing build due to addon.sass not found #581

Open BobrImperator opened 6 years ago

BobrImperator commented 6 years ago

The problem

When attempting to use ember-table in a project, that uses sass files for styles, then the build fails. This happens by default here, because ember-table has styles in both addon and app directories.

image

Fix

As documented in https://github.com/aexmachina/ember-cli-sass#alternative-addon-usage The Table does exactly that, but as mentioned there are styles inside addon directory as well, and they mustn't be there, because that's The Problem.

@import 'ember-table/default'
pzuraq commented 6 years ago

If this is going to be an issue I think we should stop relying on Sass for our addon styles and convert it to plain CSS. The styles are very minimal, we don't really need a preprocessor.

ohcibi commented 6 years ago

I added a quickly translated with searchnreplacing the {}; addon.sass and put it in the addon/styles directory and the errors was gone. I configured my project to use sass instead of scss so that might be the reason why it tries to pick up the wrong one. It might have to do with https://github.com/aexmachina/ember-cli-sass/issues/163 as several addons are reporting issues regarding that error message.

kpfefferle commented 4 years ago

I'm now working on a project that does not use Sass or ember-cli-sass, and it's extremely difficult to get this working since it only ships Sass. If this addon shipped plain CSS instead, it would be much easier to integrate with any project's CSS pipeline.

I'm going to create a branch with plain CSS so that our team can look at it and discuss the merits of changing the approach.

ohcibi commented 4 years ago

It would be convenient to have a hotfix regarding deletion of addon/styles as this would fix failing builds for project that use .sass as an extension. The underlying problem is from ember-cli-sass anyways so the long term fix would indeed be to avoid using sass at all (although its not a problem to use it as long as there is no addon.(scss|sass) file)

icyrizard commented 4 years ago

This is apparently still an issue. I'm testing out this library to see if it's something for our project. We recently moved away from compass and are using ember-cli-sass in combination with sass (not node-sass as that gives a whole other list of problems installing). My solution is to add this in the package.json within the script tag:

"scripts": {
   "postinstall": "rm -rf node_modules/ember-table/addon/styles"
},

After that it stopped complaining / crashing.

I also added this to styles/app.scss

@import 'ember-table/default'