2

I have a Rails/React project. It's using Rails/webpack 3.3.0. To precompile react code, I executed:

rails assets:precompile RAILS_ENV=development

But I am getting this error:

[Webpacker] Compilation failed:

(node:47256) DeprecationWarning: Tapable.apply is deprecated.

Call apply on the plugin directly instead (node:47256) DeprecationWarning:

Tapable.plugin is deprecated. Use new API on .hooks instead

TypeError: dep.getResourceIdentifier is not a function

Is this something you faced before? Would you like to help me to fix thsi problem?

Here is my package.json

{
  "dependencies": {
    "@rails/webpacker": "3.3.0",
    "babel-core": "6",
    "babel-loader": "^7.1.4",
    "babel-preset-react": "^6.24.1",
    "caniuse-lite": "^1.0.3000697",
    "classnames": "^2.2.5",
    "coffee-loader": "^0.9.0",
    "coffeescript": "^2.2.2",
    "debounce": "^1.1.0",
    "es6-shim": "^0.35.3",
    "extract-text-webpack-plugin": "^4.0.0-beta.0",
    "mobile-detect": "^1.4.1",
    "prop-types": "^15.6.1",
    "react": "16.0.0",
    "react-addons-css-transition-group": "^16.0.0-alpha.3",
    "react-addons-update": "^15.6.2",
    "react-bootstrap": "^0.32.1",
    "react-dom": "^16.2.0",
    "react-dom-factories": "^1.0.2",
    "react_ujs": "^2.4.4",
    "uglifyjs-webpack-plugin": "^1.2.5",
    "webpack": "4.0.0"
  },
  "devDependencies": {
    "webpack-cli": "^2.0.15",
    "webpack-dev-server": "^3.1.0"
  },
  "license": "UNLICENSED",
  "private": true
}
2
  • Which version of node and npm do you have installed? Commented Apr 27, 2018 at 18:30
  • can you try running npm install extract-text-webpack-plugin@next --save-dev and see if that solves the isuue? Commented Apr 27, 2018 at 18:31

1 Answer 1

1

The version of Webpacker you are using isn't compatible with Webpack 4.

However, it looks like support is close, Webpack 4.x support has been merged: https://github.com/rails/webpacker/pull/1316

And there's a Webpacker 4.x preview release: https://rubygems.org/gems/webpacker

So I believe you want to use Webpack 3.x for the time being, or go bleeding edge and try the prerelease.

With that said, I'm going to give the prerelease a go, I've been waiting for Webpack 4.x support!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.