Skip to content
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

bug(update): realFavicon doesn't work after upgrade Node.js to version 12 #46

Closed
Kristinita opened this issue May 17, 2019 · 7 comments
Closed

Comments

@Kristinita
Copy link

Kristinita commented May 17, 2019

1. Summary

I upgrade Node.js to version 12 → I get bug.

For Node.js 11 grunt-real-favicon successful works for me.

2. Environment

  • Operation system:

    • Windows 10 Enterprise LTSB 64-bit EN (local)
    • Ubuntu 14.04.5 LTS (Travis CI)
  • Node.js:

    • 11.15.0 (works)
    • 12.2.0 (doesn't work)
  • grunt-cli 1.2.0

  • grunt 1.0.4

  • grunt-real-favicon 0.2.3

3. Files

See KiraRealFavicon branch of my debugging repository:

  • travis.yml:
git:
  depth: 1
language: node_js
node_js:
- 11
- 12
install:
- npm install -g grunt-cli
before_script:
- npm install
script:
- grunt realFavicon --verbose
module.exports = (grunt) ->

    grunt.loadNpmTasks 'grunt-real-favicon'
    grunt.initConfig
        realFavicon:
            favicons:
                src: "kristinita-favicon.png"
                dest: "."
                options:
                    iconsPath: "."
                    html: ["index.html"]
                    design:
                        ios:
                            pictureAspect: "noChange"
                            assets:
                                ios6AndPriorIcons: false
                                ios7AndLaterIcons: false
                                precomposedIcons: false
                                declareOnlyDefaultIcon: true
                            appName: "Kristinita\'s Search"
                        desktopBrowser: {}
                        windows:
                            pictureAspect: "noChange"
                            backgroundColor: "#ffc40d"
                            onConflict: "override"
                            assets:
                                windows80Ie10Tile: false
                                windows10Ie11EdgeTiles:
                                    small: false
                                    medium: true
                                    big: false
                                    rectangle: false
                            appName: "Kristinita\'s Search"
                        androidChrome:
                            pictureAspect: "noChange"
                            themeColor: "#ffffff"
                            manifest:
                                name: "Kristinita\'s Search"
                                startUrl: "https://kristinita.github.io"
                                display: "standalone"
                                orientation: "notSet"
                                onConflict: "override"
                                declared: true
                            assets:
                                legacyIcon: false
                                lowResolutionIcons: false
                        safariPinnedTab:
                            pictureAspect: "blackAndWhite"
                            threshold: 50
                            themeColor: "#d55b9a"
                    settings:
                        scalingAlgorithm: "Mitchell"
                        errorOnImageTooSmall: false
                        readmeFile: false
                        htmlCodeFile: false
                        usePathAsIs: false

    return

4. Expected behavior

If Node.js = 11.15.0:

The command "grunt realFavicon --verbose" exited with 0.

5. Non-expected behavior

Else Node.js = 12.2.0:

    I get a bug:

Loading "real_favicon.js" tasks…ERROR
>> ReferenceError: primordials is not defined
>>   at fs.js:27:26
>>   at req_ (/home/travis/build/Kristinita/SashaGruntDebugging/node_modules/natives/index.js:143:24)
>>   at Object.req [as require] (/home/travis/build/Kristinita/SashaGruntDebugging/node_modules/natives/index.js:55:10)
>>   at Object.<anonymous> (/home/travis/build/Kristinita/SashaGruntDebugging/node_modules/unzip2/node_modules/graceful-fs/fs.js:1:37)
>>   at Module._compile (internal/modules/cjs/loader.js:759:30)
>>   at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
>>   at Module.load (/home/travis/build/Kristinita/SashaGruntDebugging/node_modules/coffeescript/lib/coffee-script/register.js:45:36)
>>   at Function.Module._load (internal/modules/cjs/loader.js:555:12)
>>   at Module.require (internal/modules/cjs/loader.js:666:19)
>>   at require (internal/modules/cjs/helpers.js:16:16)
>>   at Object.<anonymous> (/home/travis/build/Kristinita/SashaGruntDebugging/node_modules/unzip2/node_modules/graceful-fs/graceful-fs.js:3:27)
>>   at Module._compile (internal/modules/cjs/loader.js:759:30)
>>   at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
>>   at Module.load (/home/travis/build/Kristinita/SashaGruntDebugging/node_modules/coffeescript/lib/coffee-script/register.js:45:36)
>>   at Function.Module._load (internal/modules/cjs/loader.js:555:12)
>>   at Module.require (internal/modules/cjs/loader.js:666:19)
>>   at require (internal/modules/cjs/helpers.js:16:16)
>>   at Object.<anonymous> (/home/travis/build/Kristinita/SashaGruntDebugging/node_modules/unzip2/node_modules/fstream/lib/reader.js:4:10)
>>   at Module._compile (internal/modules/cjs/loader.js:759:30)
>>   at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
>>   at Module.load (/home/travis/build/Kristinita/SashaGruntDebugging/node_modules/coffeescript/lib/coffee-script/register.js:45:36)
>>   at Function.Module._load (internal/modules/cjs/loader.js:555:12)
>>   at Module.require (internal/modules/cjs/loader.js:666:19)
>>   at require (internal/modules/cjs/helpers.js:16:16)
>>   at Object.<anonymous> (/home/travis/build/Kristinita/SashaGruntDebugging/node_modules/unzip2/node_modules/fstream/fstream.js:2:18)
>>   at Module._compile (internal/modules/cjs/loader.js:759:30)
>>   at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
>>   at Module.load (/home/travis/build/Kristinita/SashaGruntDebugging/node_modules/coffeescript/lib/coffee-script/register.js:45:36)
>>   at Function.Module._load (internal/modules/cjs/loader.js:555:12)
>>   at Module.require (internal/modules/cjs/loader.js:666:19)
>>   at require (internal/modules/cjs/helpers.js:16:16)
>>   at Object.<anonymous> (/home/travis/build/Kristinita/SashaGruntDebugging/node_modules/unzip2/lib/extract.js:6:14)
>>   at Module._compile (internal/modules/cjs/loader.js:759:30)
>>   at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
>>   at Module.load (/home/travis/build/Kristinita/SashaGruntDebugging/node_modules/coffeescript/lib/coffee-script/register.js:45:36)
>>   at Function.Module._load (internal/modules/cjs/loader.js:555:12)
>>   at Module.require (internal/modules/cjs/loader.js:666:19)
>>   at require (internal/modules/cjs/helpers.js:16:16)
>>   at Object.<anonymous> (/home/travis/build/Kristinita/SashaGruntDebugging/node_modules/unzip2/unzip.js:4:19)
>>   at Module._compile (internal/modules/cjs/loader.js:759:30)
>>   at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
>>   at Module.load (/home/travis/build/Kristinita/SashaGruntDebugging/node_modules/coffeescript/lib/coffee-script/register.js:45:36)
>>   at Function.Module._load (internal/modules/cjs/loader.js:555:12)
>>   at Module.require (internal/modules/cjs/loader.js:666:19)
>>   at require (internal/modules/cjs/helpers.js:16:16)
>>   at Object.module.exports.init (/home/travis/build/Kristinita/SashaGruntDebugging/node_modules/rfg-api/index.js:17:15)
>>   at Object.module.exports (/home/travis/build/Kristinita/SashaGruntDebugging/node_modules/grunt-real-favicon/tasks/real_favicon.js:16:32)
>>   at loadTask (/home/travis/build/Kristinita/SashaGruntDebugging/node_modules/grunt/lib/grunt/task.js:315:10)
>>   at /home/travis/build/Kristinita/SashaGruntDebugging/node_modules/grunt/lib/grunt/task.js:351:7
>>   at Array.forEach (<anonymous>:null:null)
>>   at loadTasks (/home/travis/build/Kristinita/SashaGruntDebugging/node_modules/grunt/lib/grunt/task.js:350:11)
>>   at Task.task.loadNpmTasks (/home/travis/build/Kristinita/SashaGruntDebugging/node_modules/grunt/lib/grunt/task.js:398:5)
>>   at Object.module.exports (/home/travis/build/Kristinita/SashaGruntDebugging/Gruntfile.coffee:3:8)
>>   at loadTask (/home/travis/build/Kristinita/SashaGruntDebugging/node_modules/grunt/lib/grunt/task.js:315:10)
>>   at Task.task.init (/home/travis/build/Kristinita/SashaGruntDebugging/node_modules/grunt/lib/grunt/task.js:434:5)
>>   at Object.grunt.tasks (/home/travis/build/Kristinita/SashaGruntDebugging/node_modules/grunt/lib/grunt.js:111:8)
>>   at Object.module.exports [as cli] (/home/travis/build/Kristinita/SashaGruntDebugging/node_modules/grunt/lib/grunt/cli.js:27:9)
>>   at Object.<anonymous> (/home/travis/build/Kristinita/SashaGruntDebugging/node_modules/grunt/node_modules/grunt-cli/bin/grunt:44:20)
>>   at Module._compile (internal/modules/cjs/loader.js:759:30)
>>   at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
>>   at Module.load (internal/modules/cjs/loader.js:628:32)
>>   at Function.Module._load (internal/modules/cjs/loader.js:555:12)
>>   at Module.require (internal/modules/cjs/loader.js:666:19)
>>   at require (internal/modules/cjs/helpers.js:16:16)
>>   at Object.<anonymous> (/home/travis/build/Kristinita/SashaGruntDebugging/node_modules/grunt/bin/grunt:3:1)
>>   at Module._compile (internal/modules/cjs/loader.js:759:30)
>>   at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
>>   at Module.load (internal/modules/cjs/loader.js:628:32)
>>   at Function.Module._load (internal/modules/cjs/loader.js:555:12)
>>   at Function.Module.runMain (internal/modules/cjs/loader.js:822:10)
>>   at internal/main/run_main_module.js:17:11
Initializing config…OK
Loading "Gruntfile.coffee" tasks…OK
>> No tasks were registered or unregistered.
Running tasks: realFavicon
Warning: Task "realFavicon" not found. Use --force to continue.
Aborted due to warnings.
The command "grunt realFavicon --verbose" exited with 3.

Thanks.

@phbernard
Copy link
Contributor

Thank you for the comprehensive report!

Looking for known issues, I'm finding problems with Gulp (eg. gulpjs/gulp#2324)... which is not what you are using, you are on Grunt. Yet, it's hard not to think about broken stuff that should be fixed by Grunt itself.

I see you are using Grunt 1.0.4, which is two months old. Node 12 is more recent. Maybe this issue should be reported to the Grunt team itself?

@Kristinita
Copy link
Author

Type: Clarify

Maybe this issue should be reported to the Grunt team itself?

I use 43 Grunt packages for my project; solely realFavicon doesn't work after upgrade Node.js to version 12.

So I post an issue here. But if you are sure, that problem in Grunt, not in realFavicon, I will move this issue to Grunt issue tracker.

Thanks.

@Kristinita
Copy link
Author

The problem still reproduce for Node.js 12.4.0.

Thanks.

@Kristinita
Copy link
Author

Node.js contributor answer:

Looking at the backtrace, it's an npm module issue. natives is deprecated because it does things with node internals. unzip2 needs to update its graceful-fs version. All other packages up the tree probably need to update dependency versions after the appropriate fixes are made.

Thanks.

@Jako
Copy link
Contributor

Jako commented Dec 25, 2019

So it could be solved by #48, since that removes the unzip2 dependency.

@gregori-goossens
Copy link

Yes, just update depndencies "rfg-api" to "0.5.0" as https://github.com/RealFaviconGenerator/grunt-real-favicon/pull/48 works well.
Is it possible to merge pull request?

@Kristinita
Copy link
Author

Status: CONFIRMED ✔️

The problem solved for me, now grunt-real-favicon successfully works in my environment.

Environment

  1. Windows 10 Pro N for Workstations 1909
  2. Node.js 14.0.1
  3. grunt 1.3.0
  4. grunt-cli 1.2.0
  5. grunt-real-favicon 0.2.4

Thanks, @Jako.

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