Jump to content

Webpack error - ReferenceError: Unknown plugin


Recommended Posts

Hi everyone,

As I am developing a new symfony based module, I am facing an issue.
I have almost finished it, everything is set up and I have made my first grid. Now, in my js folder, I have made my webpack configuration based on this one : https://github.com/PrestaShop/example-modules/tree/master/demodoctrine/js

So, I run npm run build and I have a bunch of errors saying :
Module build failed: ReferenceError: Unknown plugin "transform-object-rest-spread"specified in "..../admin/themes/new-theme/.babelrc" at 0
 

It is not a path error because the files are found.
It looks like I have skipped a npm install in the admin folder. In the admin/themes/new-theme, there is a package-lock.json but no package.json.

Do you know where this pludin needs to be installed? 
Any idea about this bug?
 

Thanks for your help!

Link to comment
Share on other sites

  • 6 months later...

Hey @Drenaï You seem to have gone through the exact thing I am currently going through. Do you by any chance remember what exactly you did in order to make it work on the new environment? did you run anything specific or did you install a certain version of npm or anything of that sort?

Link to comment
Share on other sites

  • 11 months later...

I managed to fix the issue in "production" environment in PrestaShop v1.7.8.9.

File: index.js

const $ = window.$;

$(() => {
  const grid = new window.prestashop.component.Grid('grid');
  grid.addExtension(new window.prestashop.component.GridExtensions.ReloadListExtension());
  grid.addExtension(new window.prestashop.component.GridExtensions.ExportToSqlManagerExtension());
  grid.addExtension(new window.prestashop.component.GridExtensions.FiltersResetExtension());
  grid.addExtension(new window.prestashop.component.GridExtensions.SortingExtension());
  grid.addExtension(new window.prestashop.component.GridExtensions.LinkRowActionExtension());
  grid.addExtension(new window.prestashop.component.GridExtensions.SubmitGridActionExtension());
  grid.addExtension(new window.prestashop.component.GridExtensions.SubmitBulkActionExtension());
  grid.addExtension(new window.prestashop.component.GridExtensions.BulkActionCheckboxExtension());
  grid.addExtension(new window.prestashop.component.GridExtensions.SubmitRowActionExtension());
});

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...