DenisRichartz

DenisRichartz

Phoenix deployment with Distillery

Hi!

I have a problem with deploying my Phoenix Application. I used Distillery and edeliver pretty successfully so far, but for the latest Project the javascript gets mangled in the process of building the release with distillery. With mix phoenix.server everything works fine.

After running the build locally the console output throws this at me:

app-42e08f28a4f45ef0be4d7d5abbb55c6f.js:4 Uncaught TypeError: i is not a function
    at HTMLUListElement.<anonymous> (app-42e08f28a4f45ef0be4d7d5abbb55c6f.js:4)
    at Function.each (app-42e08f28a4f45ef0be4d7d5abbb55c6f.js:1)
    at se.fn.init.each (app-42e08f28a4f45ef0be4d7d5abbb55c6f.js:1)
    at String.<anonymous> (app-42e08f28a4f45ef0be4d7d5abbb55c6f.js:4)
    at Function.each (app-42e08f28a4f45ef0be4d7d5abbb55c6f.js:1)
    at Object.reflow (app-42e08f28a4f45ef0be4d7d5abbb55c6f.js:4)
    at se.fn.init.r [as foundation] (app-42e08f28a4f45ef0be4d7d5abbb55c6f.js:4)
    at app-42e08f28a4f45ef0be4d7d5abbb55c6f.js:4
    at u (app-42e08f28a4f45ef0be4d7d5abbb55c6f.js:1)
    at d (app-42e08f28a4f45ef0be4d7d5abbb55c6f.js:1)

versions:
Elixir 1.4.4
brunch 2.7.4
npm 5.0.2
phoenix 1.2.4

brunch-config:

exports.config = {
  // See http://brunch.io/#documentation for docs.
  files: {
    javascripts: {
      joinTo: {
        "js/app.js": [/^(web\/static\/js)|(node_modules)/,"web/static/vendor/foundation.min.js"],
        "js/admin_lte2.js": "web/static/vendor/admin_lte2.js",
        "js/ex_admin_common.js": "web/static/vendor/ex_admin_common.js",
        "js/jquery.min.js": "web/static/vendor/jquery.min.js"
      },
    },
    stylesheets: {
      joinTo: {
        "css/app.css": /^(web\/static\/css)/,
        "css/admin_lte2.css": ["web/static/vendor/admin_lte2.css"],
        "css/active_admin.css.css": ["web/static/vendor/active_admin.css.css"],
      },
      order: {
        after: ["web/static/css/app.scss"] // concat app.css last
      }
    },
    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 "/web/static/assets". Files in this directory
    // will be copied to `paths.public`, which is "priv/static" by default.
    assets: /^(web\/static\/assets)/
  },

  // Phoenix paths configuration
  paths: {
    // Dependencies and current project directories to watch
    watched: [
      "web/static",
      "test/static"
    ],

    // Where to compile files to
    public: "priv/static"
  },

  // Configure your plugins
  plugins: {
    babel: {
      // Do not use ES6 compiler in vendor code
      ignore: [/web\/static\/vendor/]
    },
    sass: {
      precision: 8,
      options: {
        includePaths: [
          'node_modules/foundation-sites/scss',
        ]
      }
    }
  },

  modules: {
    autoRequire: {
      "js/app.js": ["web/static/js/app"]
    }
  },

  npm: {
    enabled: true,
    globals: {
      $: 'jquery',
      jQuery: 'jquery',
    }
  }
};

package.json:

{
  "repository": {},
  "license": "MIT",
  "scripts": {
    "deploy": "brunch build --production",
    "watch": "brunch watch --stdin"
  },
  "dependencies": {
    "foundation-sites": "^6.3.1",
    "jquery": "^2.2.4",
    "phoenix": "file:deps/phoenix",
    "phoenix_html": "file:deps/phoenix_html"
  },
  "devDependencies": {
    "babel-brunch": "~6.0.0",
    "brunch": "2.7.4",
    "clean-css-brunch": "~2.0.0",
    "css-brunch": "~2.0.0",
    "javascript-brunch": "~2.0.0",
    "sass-brunch": "^2.10.4",
    "uglify-js-brunch": "~2.0.1"
  }
}

Where Next?

Popular in Questions Top

shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID&lt;0.412.0&gt; terminating ** (Postgrex.Error) FATAL...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

Other popular topics Top

chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30048 115
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
New
sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
AstonJ
You’re a programmer, so you don’t need spoon feeding with the conventional drivel about “this is an integer.” No. You need to know what’s...
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
magnetic
Hey :wave:t3: Elixir community, I’ve been learning Elixir, and working on some side projects. My editor of choice is VSCode, and althoug...
New

We're in Beta

About us Mission Statement