# Uncaught Error: Module build failed from from ./node\_modules/rails-erb-loader/index.js

**URL:** <https://discuss.hotwired.dev/t/uncaught-error-module-build-failed-from-from-node-modules-rails-erb-loader-index-js/817>\
**Category:** General\
**Created:** [June 6, 2019, 4:52pm UTC](https://discuss.hotwired.dev/t/uncaught-error-module-build-failed-from-from-node-modules-rails-erb-loader-index-js/817 "2019-06-06T16:52:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SylarRuby](https://yyz1.discourse-cdn.com/flex027/user_avatar/discuss.hotwired.dev/sylarruby/32/106_2.png) [@SylarRuby](https://discuss.hotwired.dev/u/SylarRuby)\
**Post date:** [June 6, 2019, 4:52pm UTC](https://discuss.hotwired.dev/t/uncaught-error-module-build-failed-from-from-node-modules-rails-erb-loader-index-js/817/1 "2019-06-06T16:52:46Z")

</div>

Hi all! It’s my first ever [Rails 6 app](https://zired.io/accounts/login) in production 💥Though I have an issue with Stimulus. Based on my issues [here](https://github.com/stimulusjs/stimulus/issues/258), Im still getting that an error:

```auto
Uncaught Error: Module build failed (from ./node_modules/rails-erb-loader/index.js):
Error: rails-erb-loader failed with code: 1

```

My `.babelrc` looks like this:

```auto
{
  "presets": [
    ["@babel/preset-env", {
      "modules": false,
      "targets": {
        "browsers": "> 1%",
        "uglify": true
      },
      "useBuiltIns": "entry"
    }]
  ],

  "plugins": [
    "@babel/syntax-dynamic-import",
    "@babel/plugin-proposal-class-properties"
  ]
}

```

My `package.json`:

```auto
{
  "name": "zired",
  "private": true,
  "dependencies": {
    "@rails/actiontext": "^6.0.0-alpha",
    "@rails/webpacker": "^4.0.2",
    "activestorage": "^5.2.3",
    "axios": "^0.18.0",
    "jquery": "^3.3.1",
    "qs": "^6.7.0",
    "rails-erb-loader": "^5.5.2",
    "stimulus": "^1.1.1",
    "stripe": "6.31.2",
    "sweetalert2": "^7.12.12",
    "toastr": "^2.1.4",
    "trix": "^1.1.1",
    "@babel/plugin-proposal-class-properties": "^7.4.4",
    "@babel/plugin-syntax-dynamic-import": "^7.2.0",
    "@babel/preset-env": "^7.4.5"
  },
  "devDependencies": {
    "webpack-dev-server": "3.3.1"
  }
}

```

---

<div class="post-metadata">

**Author:** ![adrienpoly](https://yyz1.discourse-cdn.com/flex027/user_avatar/discuss.hotwired.dev/adrienpoly/32/78_2.png) [@adrienpoly](https://discuss.hotwired.dev/u/adrienpoly)\
**Post date:** [June 6, 2019, 8:47pm UTC](https://discuss.hotwired.dev/t/uncaught-error-module-build-failed-from-from-node-modules-rails-erb-loader-index-js/817/2 "2019-06-06T20:47:22Z")

</div>

in your Github issue you mention `.js.erb` being in `javascript/controllers`  
`.js.erb` belongs to views. You should only have pure `js` files in this directory
