ES Modules Build Error
ES Modules Build Error
Upgrade my editor package from datatables.net-editor-bs5 2.0.3 to datatables.net-editor-bs5 2.2.0 and get an error when trying to build. I made no changes to my Webpack that was working just fine with 2.0.3 and using the .mjs files (so I thought).
Module parse failed: Identifier 'Editor' has already been declared (9:4)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| import Editor from 'datatables.net-editor';
|
> var Editor = DataTable.Editor;
|
This question has an accepted answers - jump to answer
Answers
Hi,
Sorry you are running into a problem with this. Does it say what file specifically has that error? I've just had a look at the 2.2.0 files form a fresh download and it doesn't have
var Editor = DataTable.Editor;
in it.That said, I do recall an issue along those lines, although I can't recall exactly when it was or when it was resolved.
Could you try 2.2.2 please? I see your license will over that, so I think it makes sense to jump to the latest release.
Regards,
Allan
I believe you should take a look at the editor-bs5 package to see that code listed in error. Also the editor-bs5 package only goes to 2.2.0 there is no 2.2.2 it says. I did try manually adding editor 2.2.2 in my package.json - no luck.
Here is the full error
I'm using Encore in the webpack since it is a Symfony project. Here is the part that handles the babel-loader.
datatables.net-editor-bs5
is just a holding package - the actual code in it just prints a console message saying that the download package needs to be installed. You must run the Editorinstall.js
script as noted here - do you do that? If you give it the 2.2.2 zip file downloaded from here I think it should work okay.Let me know how you get on with it.
Allan
Yes, I do handle that at the very beginning of the build.
This is how I am using it...
Lord! I am an idiot! I did forget to update my Editor.zip! Made sure to update and everything was fine. Sorry
That will do it . Good to hear that you've got it working now!
Allan