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] Plugin parcel-plugin-pwa-manifest failed to initialize: Error: Could not locate the bindings file. #12

Closed
miniBill opened this issue May 17, 2020 · 19 comments

Comments

@miniBill
Copy link

Describe the bug

After adding parcel-plugin-pwa-manifest to my package.json (and installing it) the plugin fails to initialize.

Expected behavior

A manifest gets generated, icons get generated, relevant info gets added to index.html...

Actual behavior

The plugin fails to initialize, nothing extra happens.

$ rm -rf dist && parcel build src/index.html
⚠️  Plugin parcel-plugin-pwa-manifest failed to initialize: Error: Could not locate the bindings file. Tried:
 → /home/minibill/src/rpg-overlay/node_modules/.pnpm/registry.npmjs.org/deasync/0.1.19/node_modules/deasync/build/deasync.node
 → /home/minibill/src/rpg-overlay/node_modules/.pnpm/registry.npmjs.org/deasync/0.1.19/node_modules/deasync/build/Debug/deasync.node
 → /home/minibill/src/rpg-overlay/node_modules/.pnpm/registry.npmjs.org/deasync/0.1.19/node_modules/deasync/build/Release/deasync.node
 → /home/minibill/src/rpg-overlay/node_modules/.pnpm/registry.npmjs.org/deasync/0.1.19/node_modules/deasync/out/Debug/deasync.node
 → /home/minibill/src/rpg-overlay/node_modules/.pnpm/registry.npmjs.org/deasync/0.1.19/node_modules/deasync/Debug/deasync.node
 → /home/minibill/src/rpg-overlay/node_modules/.pnpm/registry.npmjs.org/deasync/0.1.19/node_modules/deasync/out/Release/deasync.node
 → /home/minibill/src/rpg-overlay/node_modules/.pnpm/registry.npmjs.org/deasync/0.1.19/node_modules/deasync/Release/deasync.node
 → /home/minibill/src/rpg-overlay/node_modules/.pnpm/registry.npmjs.org/deasync/0.1.19/node_modules/deasync/build/default/deasync.node
 → /home/minibill/src/rpg-overlay/node_modules/.pnpm/registry.npmjs.org/deasync/0.1.19/node_modules/deasync/compiled/10.19.0/linux/x64/deasync.node
 → /home/minibill/src/rpg-overlay/node_modules/.pnpm/registry.npmjs.org/deasync/0.1.19/node_modules/deasync/addon-build/release/install-root/deasync.node
 → /home/minibill/src/rpg-overlay/node_modules/.pnpm/registry.npmjs.org/deasync/0.1.19/node_modules/deasync/addon-build/debug/install-root/deasync.node
 → /home/minibill/src/rpg-overlay/node_modules/.pnpm/registry.npmjs.org/deasync/0.1.19/node_modules/deasync/addon-build/default/install-root/deasync.node
 → /home/minibill/src/rpg-overlay/node_modules/.pnpm/registry.npmjs.org/deasync/0.1.19/node_modules/deasync/lib/binding/node-v64-linux-x64/deasync.node
    at bindings (/home/minibill/src/rpg-overlay/node_modules/.pnpm/registry.npmjs.org/bindings/1.5.0/node_modules/bindings/bindings.js:126:9)
    at Object.<anonymous> (/home/minibill/src/rpg-overlay/node_modules/.pnpm/registry.npmjs.org/deasync/0.1.19/node_modules/deasync/index.js:30:31)
    at Module._compile (/home/minibill/.npm-global/pnpm-global/3/node_modules/.pnpm/registry.npmjs.org/v8-compile-cache/2.1.0/node_modules/v8-compile-cache/v8-compile-cache.js:194:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (/home/minibill/.npm-global/pnpm-global/3/node_modules/.pnpm/registry.npmjs.org/v8-compile-cache/2.1.0/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
    at Object.<anonymous> (/home/minibill/src/rpg-overlay/node_modules/.pnpm/registry.npmjs.org/parcel-bundler/1.12.4/node_modules/parcel-bundler/src/utils/syncPromise.js:1:79)
✨  Built in 2.04s.

dist/shlop_shloppy.275bde68.otf        507.84 KB     61ms
dist/src.9f3e7703.js                   153.55 KB    1.64s
dist/Vecna Italic.ac154c1a.otf          51.77 KB     51ms
dist/Vecna Bold Italic.8b3461fc.otf     51.59 KB     52ms
dist/Vecna Bold.f2b1e71f.otf            46.25 KB     51ms
dist/Vecna.e90a4cc7.otf                 45.88 KB     50ms
dist/src.9f3e7703.js.map                 8.04 KB      7ms
dist/style.d51937fd.css.map                879 B      1ms
dist/style.d51937fd.css                    438 B    1.63s
dist/index.html                            306 B      5ms

To reproduce

Steps to reproduce the behavior:

  • npm install parcel-plugin-pwa-manifest.

Additional context

package.json

{
    "dependencies": {
        "cssnano": "^4.1.10",
        "elm-hot": "^1.1.4",
        "node-elm-compiler": "^5.0.4",
        "parcel-bundler": "^1.12.4",
        "parcel-plugin-pwa-manifest": "^3.0.6",
        "parcel-plugin-static-files-copy": "^2.3.1",
        "typescript": "^3.8.3"
    },
    "browserslist": [
        "chrome >=76",
        "firefox >=68"
    ],
    "name": "rpg-overlay",
    "description": "RPG Overlay",
    "pwaManifest": {
        "name": "RPG Overlay",
        "shortName": "RPG OVL",
        "theme": "#CBE5E9",
        "generateIconOptions": {
            "baseIcon": "./src/favicon.svg",
            "genFavicons": true
        },
        "development": {
            "disabled": true
        }
    }
}

Node version: v10.19.0.

@miniBill
Copy link
Author

Reinstalling parcel fixed the issue 🤷‍

@miniBill
Copy link
Author

After having used this I must say... it's exactly what I was looking for: automatic, easy, generation of everything from a single svg, THANK YOU!!!

@101arrowz
Copy link
Owner

@miniBill Thanks for your support! The issue you experienced is probably due to sharp (which handles all the icon resizing) not building properly during the install. I haven't actually tried installing this plugin from scratch with PNPM or NPM, only Yarn, so if you find this bug again feel free to reopen the issue!

@miniBill
Copy link
Author

Ah, makes sense. Reinstalling parcel has probably switched sharp to the latest version for parcel too, fixing the anomaly. Well, I hope this issue helps people from the future 😁

@miniBill
Copy link
Author

miniBill commented Jun 7, 2020

Ouch, the issue presented itself again. I've tried a pnpm install --force sharp but nothing changed. Any clues on how to fix this once and for all? i should probably open an issue with either deasync, sharp or pnpm, but I'm not sure where the error lies, do you?

@miniBill miniBill reopened this Jun 7, 2020
@101arrowz
Copy link
Owner

Alright, I'll try installing PNPM to see if it's specifically with that package manager; however, I suspect it probably has something to do with your configuration. For now, could you check if this issue matches the bug you're describing? Also, please let me know what your OS and Parcel version are.

@miniBill
Copy link
Author

miniBill commented Jun 7, 2020

OS: Devuan GNU/Linux 3 (beowulf)
Parcel: 1.12.4

That issue looks similar, but the suggested solution ([p]npm install deasync / [p]npm rebuild deasync) didn't fix it for me.

@101arrowz
Copy link
Owner

101arrowz commented Jun 8, 2020

Did deleting node_modules help? Unable to reproduce even with PNPM. Your OS and Parcel version seem normal too. @miniBill

@miniBill
Copy link
Author

Nah, it didn't help

$ node --version
v10.19.0
$ tree node_modules/.pnpm/deasync@0.1.20/node_modules/deasync/
node_modules/.pnpm/deasync@0.1.20/node_modules/deasync/
├── app.code-workspace
├── bin
│   ├── darwin-x64-node-0.10
│   │   └── deasync.node
│   ├── darwin-x64-node-0.11
│   │   └── deasync.node
│   ├── darwin-x64-node-0.12
│   │   └── deasync.node
│   ├── darwin-x64-node-10
│   │   └── deasync.node
│   ├── darwin-x64-node-11
│   │   └── deasync.node
│   ├── darwin-x64-node-12
│   │   └── deasync.node
│   ├── darwin-x64-node-13
│   │   └── deasync.node
│   ├── darwin-x64-node-14
│   │   └── deasync.node
│   ├── darwin-x64-node-4
│   │   └── deasync.node
│   ├── darwin-x64-node-5
│   │   └── deasync.node
│   ├── darwin-x64-node-6
│   │   └── deasync.node
│   ├── darwin-x64-node-7
│   │   └── deasync.node
│   ├── darwin-x64-node-8
│   │   └── deasync.node
│   ├── darwin-x64-node-9
│   │   └── deasync.node
│   ├── linux-ia32-node-0.10
│   │   └── deasync.node
│   ├── linux-ia32-node-0.11
│   │   └── deasync.node
│   ├── linux-ia32-node-0.12
│   │   └── deasync.node
│   ├── linux-ia32-node-10
│   │   └── deasync.node
│   ├── linux-ia32-node-4
│   │   └── deasync.node
│   ├── linux-ia32-node-5
│   │   └── deasync.node
│   ├── linux-ia32-node-6
│   │   └── deasync.node
│   ├── linux-ia32-node-7
│   │   └── deasync.node
│   ├── linux-ia32-node-8
│   │   └── deasync.node
│   ├── linux-ia32-node-9
│   │   └── deasync.node
│   ├── linux-x64-node-0.10
│   │   └── deasync.node
│   ├── linux-x64-node-0.11
│   │   └── deasync.node
│   ├── linux-x64-node-0.12
│   │   └── deasync.node
│   ├── linux-x64-node-10
│   │   └── deasync.node
│   ├── linux-x64-node-11
│   │   └── deasync.node
│   ├── linux-x64-node-12
│   │   └── deasync.node
│   ├── linux-x64-node-13
│   │   └── deasync.node
│   ├── linux-x64-node-14
│   │   └── deasync.node
│   ├── linux-x64-node-4
│   │   └── deasync.node
│   ├── linux-x64-node-5
│   │   └── deasync.node
│   ├── linux-x64-node-6
│   │   └── deasync.node
│   ├── linux-x64-node-7
│   │   └── deasync.node
│   ├── linux-x64-node-8
│   │   └── deasync.node
│   ├── linux-x64-node-9
│   │   └── deasync.node
│   ├── win32-ia32-node-0.10
│   │   └── deasync.node
│   ├── win32-ia32-node-0.11
│   │   └── deasync.node
│   ├── win32-ia32-node-0.12
│   │   └── deasync.node
│   ├── win32-ia32-node-10
│   │   └── deasync.node
│   ├── win32-ia32-node-11
│   │   └── deasync.node
│   ├── win32-ia32-node-12
│   │   └── deasync.node
│   ├── win32-ia32-node-13
│   │   └── deasync.node
│   ├── win32-ia32-node-14
│   │   └── deasync.node
│   ├── win32-ia32-node-4
│   │   └── deasync.node
│   ├── win32-ia32-node-5
│   │   └── deasync.node
│   ├── win32-ia32-node-6
│   │   └── deasync.node
│   ├── win32-ia32-node-7
│   │   └── deasync.node
│   ├── win32-ia32-node-8
│   │   └── deasync.node
│   ├── win32-ia32-node-9
│   │   └── deasync.node
│   ├── win32-x64-node-0.10
│   │   └── deasync.node
│   ├── win32-x64-node-0.11
│   │   └── deasync.node
│   ├── win32-x64-node-0.12
│   │   └── deasync.node
│   ├── win32-x64-node-10
│   │   └── deasync.node
│   ├── win32-x64-node-11
│   │   └── deasync.node
│   ├── win32-x64-node-12
│   │   └── deasync.node
│   ├── win32-x64-node-13
│   │   └── deasync.node
│   ├── win32-x64-node-14
│   │   └── deasync.node
│   ├── win32-x64-node-4
│   │   └── deasync.node
│   ├── win32-x64-node-5
│   │   └── deasync.node
│   ├── win32-x64-node-6
│   │   └── deasync.node
│   ├── win32-x64-node-7
│   │   └── deasync.node
│   ├── win32-x64-node-8
│   │   └── deasync.node
│   └── win32-x64-node-9
│       └── deasync.node
├── binding.gyp
├── build.js
├── index.js
├── LICENSE
├── package.json
├── quick-test.js
├── README.md
├── spec
│   ├── app
│   │   ├── exec.js
│   │   ├── request.js
│   │   ├── sleep.js
│   │   └── worker-threads.js
│   └── index.js
└── src
    └── deasync.cc

@miniBill
Copy link
Author

I've:

  • nuked anything npm/pnpm under my homedir,
  • npm install -g pnpm
  • pnpm add -g pnpm
  • pnpm add -g parcel
  • removed node_modules
  • pnpm install
  • parcel build src/index.html

Same result

@101arrowz
Copy link
Owner

101arrowz commented Jun 11, 2020

I think I've figured out the issue. As it turns out, sharp doesn't depend on deasync at all. I didn't read the stack trace carefully enough; the bug is a result of syncPromise in Parcel itself using deasync in an unconventional way. I suggest uninstalling and reinstalling the plugin; previously, the plugin used deprecated methods, which causes deasync to be called, but as of v3 it does not. Although your package.json shows that you have v3 installed, I don't think this bug is possible unless v2 is installed.

@miniBill See if npm uninstall parcel-plugin-pwa-manifest and then npm install parcel-plugin-pwa-manifest fixes things.

@miniBill
Copy link
Author

$ pnpm uninstall parcel-plugin-pwa-manifest 
Packages: -52
----------------------------------------------------
Resolving: total 101, reused 98, downloaded 0, done

dependencies:
- parcel-plugin-pwa-manifest 3.0.7

~/src/rpg-overlay on  master! ⌚ 2:20:31
$ pnpm add parcel-plugin-pwa-manifest
Packages: +52
++++++++++++++++++++++++++++++++++++++++++++++++++++
Resolving: total 183, reused 183, downloaded 0, done
node_modules/.pnpm/sharp@0.25.3/node_modules/sharp: Running install script, done in 3s

dependencies:
+ parcel-plugin-pwa-manifest 3.0.7

~/src/rpg-overlay on  master! ⌚ 2:20:50
$ rm -rf dist && parcel build src/index.html  
⚠️  Plugin parcel-plugin-pwa-manifest failed to initialize: Error: Could not locate the bindings file. Tried:
 → /home/minibill/src/rpg-overlay/node_modules/.pnpm/deasync@0.1.20/node_modules/deasync/build/deasync.node
 → /home/minibill/src/rpg-overlay/node_modules/.pnpm/deasync@0.1.20/node_modules/deasync/build/Debug/deasync.node
 → /home/minibill/src/rpg-overlay/node_modules/.pnpm/deasync@0.1.20/node_modules/deasync/build/Release/deasync.node
 → /home/minibill/src/rpg-overlay/node_modules/.pnpm/deasync@0.1.20/node_modules/deasync/out/Debug/deasync.node
 → /home/minibill/src/rpg-overlay/node_modules/.pnpm/deasync@0.1.20/node_modules/deasync/Debug/deasync.node
 → /home/minibill/src/rpg-overlay/node_modules/.pnpm/deasync@0.1.20/node_modules/deasync/out/Release/deasync.node
 → /home/minibill/src/rpg-overlay/node_modules/.pnpm/deasync@0.1.20/node_modules/deasync/Release/deasync.node
 → /home/minibill/src/rpg-overlay/node_modules/.pnpm/deasync@0.1.20/node_modules/deasync/build/default/deasync.node
 → /home/minibill/src/rpg-overlay/node_modules/.pnpm/deasync@0.1.20/node_modules/deasync/compiled/10.19.0/linux/x64/deasync.node
 → /home/minibill/src/rpg-overlay/node_modules/.pnpm/deasync@0.1.20/node_modules/deasync/addon-build/release/install-root/deasync.node
 → /home/minibill/src/rpg-overlay/node_modules/.pnpm/deasync@0.1.20/node_modules/deasync/addon-build/debug/install-root/deasync.node
 → /home/minibill/src/rpg-overlay/node_modules/.pnpm/deasync@0.1.20/node_modules/deasync/addon-build/default/install-root/deasync.node
 → /home/minibill/src/rpg-overlay/node_modules/.pnpm/deasync@0.1.20/node_modules/deasync/lib/binding/node-v64-linux-x64/deasync.node
    at bindings (/home/minibill/src/rpg-overlay/node_modules/.pnpm/bindings@1.5.0/node_modules/bindings/bindings.js:126:9)
    at Object.<anonymous> (/home/minibill/src/rpg-overlay/node_modules/.pnpm/deasync@0.1.20/node_modules/deasync/index.js:30:31)
    at Module._compile (/home/minibill/.npm-global/pnpm-global/4/node_modules/.pnpm/v8-compile-cache@2.1.1/node_modules/v8-compile-cache/v8-compile-cache.js:194:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (/home/minibill/.npm-global/pnpm-global/4/node_modules/.pnpm/v8-compile-cache@2.1.1/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
    at Object.<anonymous> (/home/minibill/src/rpg-overlay/node_modules/.pnpm/parcel-bundler@1.12.4/node_modules/parcel-bundler/src/utils/syncPromise.js:1:79)

@101arrowz
Copy link
Owner

Could you make a repo to reproduce this bug? I think I know how it's happening but it seems impossible to me.

@miniBill
Copy link
Author

Done! Created as private and added you as a collaborator because I'm not ready for publishing it yet

@101arrowz
Copy link
Owner

101arrowz commented Jun 12, 2020

I'm actually unable to reproduce the error even in that repo. My suggestion is to look for the difference between /home/minibill/src/rpg-overlay/node_modules/.pnpm/registry.npmjs.org/deasync (which the plugin was expecting) versus /home/minibill/src/rpg-overlay/node_modules/.pnpm/deasync@VERSION (which you showed in your tree output). @miniBill

@101arrowz
Copy link
Owner

@miniBill Is there a difference between the two directories above?

@miniBill
Copy link
Author

miniBill commented Jun 17, 2020

There is no registry.npmjs.org below .pnpm on my computer.
If you see the latest error message I posted that substring isn't there anymore.

In the end I managed to fix it:

$ pnpm add -g node-gyp
....
$ cd ~/src/rpg-overlay/node_modules/.pnpm/deasync@0.1.20/node_modules/deasync
$ node-gyp rebuild
...

And now it works 🤷

@101arrowz
Copy link
Owner

Sorry you had to go through so much difficulty to get that to work! I'll look into this more and try to fix it in the future.

@miniBill
Copy link
Author

New project, same error. Fortunately calling node-gyp manually fixed it this time too.
One strange thing about my system: I don't have npm installed.

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

2 participants