Skip to content

ERROR when Uglify #3

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

Closed
eric7578 opened this issue Apr 25, 2018 · 5 comments
Closed

ERROR when Uglify #3

eric7578 opened this issue Apr 25, 2018 · 5 comments

Comments

@eric7578
Copy link

eric7578 commented Apr 25, 2018

I am using the drafjs-mention-plugin, but when I try to build in the production, I got this error.
The version of the mention-plugin is 2.1.0

ERROR in vendor.c0939953.js from UglifyJs

I digging into the node_modules/find-with-regex/build/index.js
I found that maybe it's the first line of the following code that causing this error

import 'draft-js';

var findWithRegex = function findWithRegex(regex, contentBlock, callback) {
  // Get the text from the contentBlock
  var text = contentBlock.getText();
  var matchArr = void 0;
  var start = void 0; // eslint-disable-line
  // Go through all matches in the text and return the indizes to the callback
  while ((matchArr = regex.exec(text)) !== null) {
    // eslint-disable-line
    if (matchArr.index === regex.lastIndex) {
      regex.lastIndex++;
    }
    start = matchArr.index;
    callback(start, start + matchArr[0].length);
  }
};

@mbutsykin
Copy link

mbutsykin commented Apr 25, 2018

+1, build version of [email protected] (build/index.js) contains not built source

@eric7578
Copy link
Author

@mbutsykin I found that the npm version matters, in my case if the npm version is v3.x.x it brokes. However I tried to switch to v6.0.0 it works fine. Is it the same in your case?

@andreieftimie
Copy link

We reverted to 1.0.2 to overcome this issue.

@juliankrispel
Copy link
Member

fixed in latest version!

@juliankrispel
Copy link
Member

thanks for the report folks!

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

4 participants