Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: webpackHandler.getBabelCssRule is not a function #4

Open
mirzasuga opened this issue Oct 27, 2019 · 0 comments
Open

Comments

@mirzasuga
Copy link

hi guys, i got this error when i try to run fresh installation, please anyone can help me?

webpack.js:48 Uncaught TypeError: webpackHandler.getBabelCssRule is not a function
    at PawImageOptimizerWebpack.apply (webpack.js:48)
    at ClientHandler.addPlugin (handler.js:259)
    at new Client (client.js:47)
    at Module.eval (app.js:34)
    at eval (app.js:75)
    at Module../node_modules/@pawjs/pawjs/src/client/app.js (2a1f20cc5ca1611199e6.js:118)
    at __webpack_require__ (07e05f344e40c25a1c0a.js:791)
    at fn (07e05f344e40c25a1c0a.js:151)
    at Module.eval (hot-app.js:6)
    at eval (hot-app.js:49)

here is my client.js file

import LessPlugin from '@pawjs/less/webpack';

import ReduxClient from '@pawjs/redux/client';
import * as AppReducers from './reducers';

const appInitialState = {};

export default class Client {
  constructor({ addPlugin }) {
    const reduxClient = new ReduxClient({ addPlugin });
    
    reduxClient.setReducers(AppReducers);
    
    addPlugin(reduxClient);
    addPlugin(new LessPlugin);
  }
apply(clientHandler) {
    clientHandler.hooks.reduxInitialState.tapPromise('ReduxInitialState', async ({getInitialState, setInitialState}) => {
      const initialState = Object.assign({}, getInitialState(), appInitialState);
      setInitialState(initialState);
    })

    clientHandler.hooks.locationChange.tapPromise('ReloadAds', async () => this.advertise());
    clientHandler.hooks.locationChange.tapPromise('ReloadGoogleTrack', async () => Client.googleTrack());
    clientHandler.hooks.renderComplete.tap('ReloadAds', async () => this.advertise());
  }
}

here is my webpack.js

import SrcsetPlugin from '@pawjs/srcset/webpack';
import ImageOptimizer from '@pawjs/image-optimizer/webpack';

export default class ProjectWebpack {
  constructor({ addPlugin }) {
    // Add sass compiler to the project
    const optimizerOptions = {
      supportedEnv: [
        'production',
      ],
      configLabel: 'MEDIUM_QUALITY',
    };
    addPlugin(new ImageOptimizer(optimizerOptions));

    addPlugin(new SrcsetPlugin());
    const options = {
      javascriptEnabled: true,
    };
    addPlugin(new LessPlugin(options));
  }
}

and here is my package.json

"dependencies": {
    "@pawjs/image-optimizer": "^2.2.2",
    "@pawjs/pawjs": "^3.0.0-alpha.14",
    "@pawjs/srcset": "^2.1.1",
    "@types/react": "^16.8.19",
    "@types/react-dom": "^16.8.4",
    "antd": "^3.24.2",
    "bulma": "^0.7.5",
    "cloudinary": "^1.14.0",
    "eslint-import-resolver-webpack": "^0.11.1",
    "fork-ts-checker-webpack-plugin": "^1.3.5",
    "prop-types": "^15.7.2",
    "redux-saga": "^1.1.1",
    "snyk": "^1.173.1",
    "universal-fetch": "^1.0.0"
  },
  "snyk": true,
  "devDependencies": {
    "@pawjs/less": "^2.1.1",
    "@pawjs/redux": "^2.2.0",
    "@pawjs/sass": "^2.2.1",
    "react-redux": "^7.1.1",
    "redux": "^4.0.4",
    "webpack-bundle-analyzer": "^3.3.2"
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant