patrickhulce / fontmin-webpack

Minifies icon fonts to just the used glyphs.
MIT License
139 stars 19 forks source link

Repeat unicode, glyph index: 1 #10

Closed Buom01 closed 6 years ago

Buom01 commented 6 years ago

Hi, Using fontmin-webpack@^1.0.2 with webpack 3 to minimize @mdi/font@2.5.94, I am getting the error Repeat unicode, glyph index: 1 fired in fonteditor-core

I have already makes research:

Since this package only remove glyph, I think that the error is probably related to fontmin-webpack since if everything went right then fonteditor-core shouldn't complain of a problem of "reserved operator" while compiling fonts

Where is the problem ? Should I open an issue on one of the others packages ?

In the function computeFinalGlyphs returned glyph are (note that the first seem glitched):

[ '\u0000',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '',
  '•' ]

Details of fontmin-webpack;

├─┬ fontmin-webpack@1.0.2
│ ├─┬ debug@2.6.9
│ │ └── ms@2.0.0 deduped
│ ├─┬ fontmin@0.9.6
│ │ ├── b3b@0.0.1
│ │ ├─┬ buffer-to-vinyl@1.1.0
│ │ │ ├── file-type@3.9.0
│ │ │ ├── readable-stream@2.3.6 deduped
│ │ │ ├── uuid@2.0.3
│ │ │ └─┬ vinyl@1.2.0
│ │ │   ├── clone@1.0.4 deduped
│ │ │   ├── clone-stats@0.0.1
│ │ │   └── replace-ext@0.0.1 deduped
│ │ ├─┬ concat-stream@1.6.2
│ │ │ ├── buffer-from@1.1.0
│ │ │ ├── inherits@2.0.3 deduped
│ │ │ ├── readable-stream@2.3.6 deduped
│ │ │ └── typedarray@0.0.6
│ │ ├─┬ fonteditor-core@0.0.21
│ │ │ └── xmldom@0.1.27
│ │ ├── get-stdin@5.0.1
│ │ ├─┬ is-otf@0.1.2
│ │ │ └── b3b@0.0.1 deduped
│ │ ├── is-svg@1.1.1
│ │ ├─┬ is-ttf@0.2.2
│ │ │ └── b3b@0.0.1 deduped
│ │ ├── lodash@4.17.10 deduped
│ │ ├─┬ meow@3.7.0
│ │ │ ├─┬ camelcase-keys@2.1.0
│ │ │ │ ├── camelcase@2.1.1
│ │ │ │ └── map-obj@1.0.1 deduped
│ │ │ ├── decamelize@1.2.0 deduped
│ │ │ ├─┬ loud-rejection@1.6.0
│ │ │ │ ├─┬ currently-unhandled@0.4.1
│ │ │ │ │ └── array-find-index@1.0.2
│ │ │ │ └── signal-exit@3.0.2 deduped
│ │ │ ├── map-obj@1.0.1
│ │ │ ├── minimist@1.2.0
│ │ │ ├─┬ normalize-package-data@2.4.0
│ │ │ │ ├── hosted-git-info@2.6.0
│ │ │ │ ├─┬ is-builtin-module@1.0.0
│ │ │ │ │ └── builtin-modules@1.1.1
│ │ │ │ ├── semver@5.5.0 deduped
│ │ │ │ └─┬ validate-npm-package-license@3.0.3
│ │ │ │   ├─┬ spdx-correct@3.0.0
│ │ │ │   │ ├── spdx-expression-parse@3.0.0 deduped
│ │ │ │   │ └── spdx-license-ids@3.0.0
│ │ │ │   └─┬ spdx-expression-parse@3.0.0
│ │ │ │     ├── spdx-exceptions@2.1.0
│ │ │ │     └── spdx-license-ids@3.0.0 deduped
│ │ │ ├── object-assign@4.1.1 deduped
│ │ │ ├─┬ read-pkg-up@1.0.1
│ │ │ │ ├─┬ find-up@1.1.2
│ │ │ │ │ ├─┬ path-exists@2.1.0
│ │ │ │ │ │ └── pinkie-promise@2.0.1 deduped
│ │ │ │ │ └── pinkie-promise@2.0.1 deduped
│ │ │ │ └─┬ read-pkg@1.1.0
│ │ │ │   ├─┬ load-json-file@1.1.0
│ │ │ │   │ ├── graceful-fs@4.1.11 deduped
│ │ │ │   │ ├── parse-json@2.2.0 deduped
│ │ │ │   │ ├── pify@2.3.0
│ │ │ │   │ ├── pinkie-promise@2.0.1 deduped
│ │ │ │   │ └── strip-bom@2.0.0 deduped
│ │ │ │   ├── normalize-package-data@2.4.0 deduped
│ │ │ │   └─┬ path-type@1.1.0
│ │ │ │     ├── graceful-fs@4.1.11 deduped
│ │ │ │     ├── pify@2.3.0
│ │ │ │     └── pinkie-promise@2.0.1 deduped
│ │ │ ├─┬ redent@1.0.0
│ │ │ │ ├─┬ indent-string@2.1.0
│ │ │ │ │ └── repeating@2.0.1 deduped
│ │ │ │ └─┬ strip-indent@1.0.1
│ │ │ │   └── get-stdin@4.0.1
│ │ │ └── trim-newlines@1.0.0
│ │ ├── pako@1.0.6
│ │ ├── replace-ext@0.0.1
│ │ ├─┬ stream-combiner@0.2.2
│ │ │ ├── duplexer@0.1.1
│ │ │ └── through@2.3.8 deduped
│ │ ├─┬ through2@2.0.1
│ │ │ ├─┬ readable-stream@2.0.6
│ │ │ │ ├── core-util-is@1.0.2 deduped
│ │ │ │ ├── inherits@2.0.3 deduped
│ │ │ │ ├── isarray@1.0.0 deduped
│ │ │ │ ├── process-nextick-args@1.0.7
│ │ │ │ ├── string_decoder@0.10.31
│ │ │ │ └── util-deprecate@1.0.2 deduped
│ │ │ └── xtend@4.0.1
│ │ └─┬ vinyl-fs@2.4.3
│ │   ├── duplexify@3.6.0 deduped
│ │   ├─┬ glob-stream@5.3.5
│ │   │ ├── extend@3.0.1 deduped
│ │   │ ├─┬ glob@5.0.15
│ │   │ │ ├── inflight@1.0.6 deduped
│ │   │ │ ├── inherits@2.0.3 deduped
│ │   │ │ ├── minimatch@3.0.4 deduped
│ │   │ │ ├── once@1.4.0 deduped
│ │   │ │ └── path-is-absolute@1.0.1 deduped
│ │   │ ├── glob-parent@3.1.0 deduped
│ │   │ ├── micromatch@2.3.11 deduped
│ │   │ ├─┬ ordered-read-streams@0.3.0
│ │   │ │ ├── is-stream@1.1.0 deduped
│ │   │ │ └── readable-stream@2.3.6 deduped
│ │   │ ├─┬ through2@0.6.5
│ │   │ │ ├─┬ readable-stream@1.0.34
│ │   │ │ │ ├── core-util-is@1.0.2 deduped
│ │   │ │ │ ├── inherits@2.0.3 deduped
│ │   │ │ │ ├── isarray@0.0.1
│ │   │ │ │ └── string_decoder@0.10.31
│ │   │ │ └── xtend@4.0.1 deduped
│ │   │ ├─┬ to-absolute-glob@0.1.1
│ │   │ │ └── extend-shallow@2.0.1 deduped
│ │   │ └─┬ unique-stream@2.2.1
│ │   │   ├── json-stable-stringify@1.0.1 deduped
│ │   │   └── through2-filter@2.0.0 deduped
│ │   ├── graceful-fs@4.1.11 deduped
│ │   ├─┬ gulp-sourcemaps@1.12.1
│ │   │ ├─┬ @gulp-sourcemaps/map-sources@1.0.0
│ │   │ │ ├── normalize-path@2.1.1 deduped
│ │   │ │ └── through2@2.0.3 deduped
│ │   │ ├── acorn@4.0.13
│ │   │ ├── convert-source-map@1.5.1 deduped
│ │   │ ├── css@2.2.3 deduped
│ │   │ ├─┬ debug-fabulous@0.0.4
│ │   │ │ ├─┬ debug@2.6.9
│ │   │ │ │ └── ms@2.0.0 deduped
│ │   │ │ ├── lazy-debug-legacy@0.0.1
│ │   │ │ └── object-assign@4.1.0
│ │   │ ├── detect-newline@2.1.0
│ │   │ ├── graceful-fs@4.1.11 deduped
│ │   │ ├── source-map@0.6.1
│ │   │ ├── strip-bom@2.0.0 deduped
│ │   │ ├── through2@2.0.3 deduped
│ │   │ └── vinyl@1.2.0 deduped
│ │   ├── is-valid-glob@0.3.0
│ │   ├─┬ lazystream@1.0.0
│ │   │ └── readable-stream@2.3.6 deduped
│ │   ├── lodash.isequal@4.5.0
│ │   ├─┬ merge-stream@1.0.1
│ │   │ └── readable-stream@2.3.6 deduped
│ │   ├── mkdirp@0.5.1 deduped
│ │   ├── object-assign@4.1.1 deduped
│ │   ├── readable-stream@2.3.6 deduped
│ │   ├─┬ strip-bom@2.0.0
│ │   │ └── is-utf8@0.2.1
│ │   ├─┬ strip-bom-stream@1.0.0
│ │   │ ├── first-chunk-stream@1.0.0
│ │   │ └── strip-bom@2.0.0 deduped
│ │   ├── through2@2.0.3 deduped
│ │   ├─┬ through2-filter@2.0.0
│ │   │ ├── through2@2.0.3 deduped
│ │   │ └── xtend@4.0.1 deduped
│ │   ├── vali-date@1.0.0
│ │   └── vinyl@1.2.0 deduped
│ ├── lodash@4.17.10 deduped
│ ├─┬ ttf2woff2@2.0.3
│ │ ├── bindings@1.3.0
│ │ ├─┬ bufferstreams@1.1.3
│ │ │ └── readable-stream@2.3.6 deduped
│ │ ├── nan@2.10.0 deduped
│ │ └─┬ node-gyp@3.7.0
│ │   ├─┬ fstream@1.0.11
│ │   │ ├── graceful-fs@4.1.11 deduped
│ │   │ ├── inherits@2.0.3 deduped
│ │   │ ├── mkdirp@0.5.1 deduped
│ │   │ └── rimraf@2.6.2 deduped
│ │   ├── glob@7.1.2 deduped
│ │   ├── graceful-fs@4.1.11 deduped
│ │   ├── mkdirp@0.5.1 deduped
│ │   ├─┬ nopt@3.0.6
│ │   │ └── abbrev@1.1.1
│ │   ├── npmlog@4.1.2 deduped
│ │   ├─┬ osenv@0.1.5
│ │   │ ├── os-homedir@1.0.2 deduped
│ │   │ └── os-tmpdir@1.0.2 deduped
│ │   ├─┬ request@2.81.0
│ │   │ ├── aws-sign2@0.6.0
│ │   │ ├── aws4@1.7.0 deduped
│ │   │ ├── caseless@0.12.0 deduped
│ │   │ ├── combined-stream@1.0.6 deduped
│ │   │ ├── extend@3.0.1 deduped
│ │   │ ├── forever-agent@0.6.1 deduped
│ │   │ ├─┬ form-data@2.1.4
│ │   │ │ ├── asynckit@0.4.0 deduped
│ │   │ │ ├── combined-stream@1.0.6 deduped
│ │   │ │ └── mime-types@2.1.18 deduped
│ │   │ ├─┬ har-validator@4.2.1
│ │   │ │ ├── ajv@4.11.8 deduped
│ │   │ │ └── har-schema@1.0.5
│ │   │ ├── hawk@3.1.3 deduped
│ │   │ ├─┬ http-signature@1.1.1
│ │   │ │ ├── assert-plus@0.2.0
│ │   │ │ ├── jsprim@1.4.1 deduped
│ │   │ │ └── sshpk@1.14.1 deduped
│ │   │ ├── is-typedarray@1.0.0 deduped
│ │   │ ├── isstream@0.1.2 deduped
│ │   │ ├── json-stringify-safe@5.0.1 deduped
│ │   │ ├── mime-types@2.1.18 deduped
│ │   │ ├── oauth-sign@0.8.2 deduped
│ │   │ ├── performance-now@0.2.0
│ │   │ ├── qs@6.4.0 deduped
│ │   │ ├── safe-buffer@5.1.2 deduped
│ │   │ ├── stringstream@0.0.6
│ │   │ ├── tough-cookie@2.3.4 deduped
│ │   │ ├── tunnel-agent@0.6.0 deduped
│ │   │ └── uuid@3.2.1 deduped
│ │   ├── rimraf@2.6.2 deduped
│ │   ├── semver@5.3.0
│ │   ├─┬ tar@2.2.1
│ │   │ ├─┬ block-stream@0.0.9
│ │   │ │ └── inherits@2.0.3 deduped
│ │   │ ├── fstream@1.0.11 deduped
│ │   │ └── inherits@2.0.3 deduped
│ │   └── which@1.3.1 deduped
│ └─┬ webpack-sources@0.1.5
│   ├── source-list-map@0.1.8
│   └── source-map@0.5.7 deduped
patrickhulce commented 6 years ago

Thanks for filing @Buom01 :)

Do you have a repro available as a gist or github repo? I'd need a bit more of the webpack config and the fontmin/fontmin-webpack settings that were used.

Buom01 commented 6 years ago

I found that the glyph "\u0000" is the problem, My project is really big and a large part of it is private, however, I will create a repo to reproduce this bug.

Is it OK if I use preact-cli or do you have preference for a quick base ?

patrickhulce commented 6 years ago

Oh good sleuthing! preact-cli is fine, anything I can download and run to bump into this is perfect 👌

Buom01 commented 6 years ago

Whatever that I tried, i did not succeed to reproduce the issue :/ I mainly tried almost all of my css + the extarnal ones and always with @mdi/font/css/materialdesignicons.min.css

As temporary solution I filter "\u0000" in the function computeFinalGlyphs

Giving up for now

patrickhulce commented 6 years ago

Hm, alright :/ thanks for trying anyhow!