ex_admin
ex_admin copied to clipboard
** (Mix) Can't find brunch-config.js
On phoenix 1.3, when i run:
mix admin.install
I get :
** (Mix) Can't find brunch-config.js
I have the same issue. Using it with an umbrella project with Phoenix 1.3 and Elixir 1.4.
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.
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.
I got the same issue with Phoenix 1.3.0 😢
Quick solution: mix admin.install --no-brunch.
accessing the admin interface after that will still give you an error though.
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.
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
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.
- Dev
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:
/brunch-config.js/priv/staticfolder/webfolder
After it installs everything, use git diff to find changes and migrate them onto 1.3 version:
- make brunch changes in
/assets/brunch-config.js - move assets from
/priv/staticto/assetsfolder. In my case I have:/assets/static/fonts//assets/static/images//assets/vendor/<- js and css files here
- move every class from
/webto/lib/your_app_web
Here is my brunch-config.js with ExAdmin support for a reference
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
}
};