smpallen99 / ex_admin

ExAdmin is an auto administration package for Elixir and the Phoenix Framework
MIT License
1.2k stars 276 forks source link

** (Mix) Can't find brunch-config.js #400

Open debonair opened 6 years ago

debonair commented 6 years ago

On phoenix 1.3, when i run:

mix admin.install

I get :

** (Mix) Can't find brunch-config.js

szabolcsmaj commented 6 years ago

I have the same issue. Using it with an umbrella project with Phoenix 1.3 and Elixir 1.4.

happysalada commented 6 years ago

This is not an official fix, but if you are stuck like me and need a solution right now, here is one. I found this closed PR https://github.com/smpallen99/ex_admin/pull/388/files You can make the same changes that he did, then recomplie the deps mix deps.compile then one more time try mix admin.install and you're good to go.

I think his PR was rejected because it breaks compatibility with previous phoenix versions. If you are only on 1.3 like me, I would say go ahead.

happysalada commented 6 years ago

Actually, the fix I recommended is just for the install script. But since phoenix 1.3 is completely different, exadmin is broken even with that fix. The install script needs to be rewritten. So sorry guys, no quick solution for now.

franzejr commented 6 years ago

I got the same issue with Phoenix 1.3.0 😢

franzejr commented 6 years ago

Quick solution: mix admin.install --no-brunch.

happysalada commented 6 years ago

accessing the admin interface after that will still give you an error though.

blisscs commented 6 years ago

Hello @franzejr , The error is still there when using --no-brunch also. I am getting ** (Mix) Can't find assets path! by manually create assets folder in the root the error still remains.

Kukunin commented 6 years ago

I worked around this error with ln -s assets/brunch-config.js .. But still it created non compatible config, so I had to adjust it along Phoenix 1.3

blisscs commented 6 years ago

Hi, @Kukunin Did you make it work. What work around did you do? I am still got stuck on the ** (Mix) Can't find assets path! My phoenix is generated using mix phx [project_name] --no-brunch I did create assets directory under the root path and web path (by creating web directory also to make it like phoenix 1.2).

If anybody have feedback please recommend.

Kukunin commented 6 years ago

Yeah, it made it work. Since the generator expects the Phoenix 1.2 file structure, you need to migrate everything to 1.3. I might be wrong since it was a month ago, but here is an idea.

It expects:

After it installs everything, use git diff to find changes and migrate them onto 1.3 version:

Here is my brunch-config.js with ExAdmin support for a reference

```js exports.config = { // See http://brunch.io/#documentation for docs. files: { javascripts: { joinTo: { "js/app.js": /^(js)|(node_modules)/, "js/ex_admin_common.js": ["vendor/ex_admin_common.js"], "js/admin_lte2.js": ["vendor/admin_lte2.js"], "js/jquery.min.js": ["vendor/jquery.min.js"] } }, stylesheets: { joinTo: { "css/app.css": /^(css)/, "css/admin_lte2.css": ["vendor/admin_lte2.css"], "css/active_admin.css.css": ["vendor/active_admin.css.css"] } }, templates: { joinTo: "js/app.js" } }, conventions: { // This option sets where we should place non-css and non-js assets in. // By default, we set this to "/assets/static". Files in this directory // will be copied to `paths.public`, which is "priv/static" by default. assets: /^(static)/ }, // Phoenix paths configuration paths: { // Dependencies and current project directories to watch watched: ["static", "css", "js", "vendor"], // Where to compile files to public: "../priv/static" }, // Configure your plugins plugins: { copycat: { "fonts": ["node_modules/font-awesome/fonts"] }, babel: { presets: ["es2015", "react"], plugins: ["transform-object-rest-spread"], // Do not use ES6 compiler in vendor code ignore: [/vendor/] }, sass: { mode: 'native', options: { includePaths: ["node_modules/bootstrap/scss", "node_modules/font-awesome/scss"], precision: 8 } } }, modules: { autoRequire: { "js/app.js": ["js/app"] } }, npm: { enabled: true } }; ```