T-PWK / flake-idgen

Flake ID generator yields k-ordered, conflict-free ids in a distributed environment in Node.js
https://www.npmjs.org/package/flake-idgen
MIT License
242 stars 20 forks source link

Version 1.4.0 crash in Webpack 4 step "UglifyJS" #10

Closed fmagaldea closed 2 years ago

fmagaldea commented 4 years ago

Hi,

Your package works fine until 1.3.0 but version 1.4.0 introduce some changes that makes build impossible with Webpack on UglifyJS step.

Error is:

ERROR in assets/bundle.js from UglifyJs
Unexpected character '`' [assets/bundle.js:203079,32]

Extract from devDependencies in our file package.json:

    "babel-core": "6.26.3",
    "babel-loader": "7.1.5",
    "babel-polyfill": "6.26.0",
    "babel-preset-env": "1.7.0",
    "babel-preset-react": "6.24.1",
    "babel-preset-stage-0": "6.24.1",
    "babel-register": "6.26.0",
    "copy-webpack-plugin": "5.1.1",
    "css-loader": "3.5.2",
    "generate-json-webpack-plugin": "0.3.1",
    "html-webpack-plugin": "4.2.0",
    "imagemin-webpack-plugin": "2.4.2",
    "style-loader": "1.1.4",
    "uglifyjs-webpack-plugin": "2.2.0",
    "url-loader": "4.1.0",
    "webpack": "4.42.1",
    "webpack-bundle-analyzer": "3.7.0",
    "webpack-cli": "3.3.11",
    "webpack-dev-server": "3.10.3",
    "webpack-merge": "4.2.2"
fmagaldea commented 3 years ago

Could be related to usage of dynamic string:

`Clock moved backwards. Refusing to generate id for ${this.lastTime - time} milliseconds`

in the last commit: https://github.com/T-PWK/flake-idgen/commit/fcd6a2f359c675a65b92388ea804dcbdae7bcb88#diff-a8c74189a1583af40cab9fd4fc8c9b733781b988d7953e49174b4d4ae2b98f09R72

Possible to fix?

fmagaldea commented 3 years ago

Same error with Webpack 5 = is broken on Internet Explorer 11

huudatk53 commented 3 years ago

me too [ExceptionsHandler] Clock moved backwards. Refusing to generate id for 1 milliseconds +1292268ms Error: Clock moved backwards. Refusing to generate id for 1 milliseconds