DenisRichartz

DenisRichartz

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? Top

Trending in Questions Top

Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
Onor.io
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
Trolleger
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
matt-savvy
Anyone here using Honeybadger? My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of Bandit.HTTPError...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews