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

Error: Could not locate the bindings file (wrangler) #3207

Closed
gkiely opened this issue Jun 4, 2023 · 11 comments
Closed

Error: Could not locate the bindings file (wrangler) #3207

gkiely opened this issue Jun 4, 2023 · 11 comments
Labels
bug Something isn't working

Comments

@gkiely
Copy link

gkiely commented Jun 4, 2023

What platform is your computer?

Darwin 21.3.0 arm64 arm

How did you attempt to install or upgrade?

bun i wrangler
wrangler

miniflare is using better-sqlite3

    "node_modules/miniflare": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.0.0.tgz",
      "integrity": "sha512-CW8yS00pQCbq2o4K8drePzJBkE0heL9cCY/O8DcYJOHd4M0RVutjrp+LqUP4hfzweZ+LqrLo8+Rzy4cORisQoQ==",
      "dev": true,
      "dependencies": {
        "better-sqlite3": "^8.1.0",

What do you see instead?

[mf:err] Error: Could not locate the bindings file. Tried:
→ /Users/grantkiely/code/my-project/node_modules/better-sqlite3/build/better_sqlite3.node
→ /Users/grantkiely/code/my-project/node_modules/better-sqlite3/build/Debug/better_sqlite3.node
→ /Users/grantkiely/code/my-project/node_modules/better-sqlite3/build/Release/better_sqlite3.node
→ /Users/grantkiely/code/my-project/node_modules/better-sqlite3/out/Debug/better_sqlite3.node
→ /Users/grantkiely/code/my-project/node_modules/better-sqlite3/Debug/better_sqlite3.node
→ /Users/grantkiely/code/my-project/node_modules/better-sqlite3/out/Release/better_sqlite3.node
→ /Users/grantkiely/code/my-project/node_modules/better-sqlite3/Release/better_sqlite3.node
→ /Users/grantkiely/code/my-project/node_modules/better-sqlite3/build/default/better_sqlite3.node
→ /Users/grantkiely/code/my-project/node_modules/better-sqlite3/compiled/20.2.0/darwin/arm64/better_sqlite3.node
→ /Users/grantkiely/code/my-project/node_modules/better-sqlite3/addon-build/release/install-root/better_sqlite3.node
→ /Users/grantkiely/code/my-project/node_modules/better-sqlite3/addon-build/debug/install-root/better_sqlite3.node
→ /Users/grantkiely/code/my-project/node_modules/better-sqlite3/addon-build/default/install-root/better_sqlite3.node
→ /Users/grantkiely/code/my-project/node_modules/better-sqlite3/lib/binding/node-v115-darwin-arm64/better_sqlite3.node
at bindings (/Users/grantkiely/code/my-project/node_modules/bindings/bindings.js:126:9)
at new Database (/Users/grantkiely/code/my-project/node_modules/better-sqlite3/lib/database.js:48:64)
at createFileStorage (/Users/grantkiely/code/my-project/node_modules/miniflare/dist/src/index.js:3627:14)
at GatewayFactory.getStorage (/Users/grantkiely/code/my-project/node_modules/miniflare/dist/src/index.js:3686:12)
at GatewayFactory.get (/Users/grantkiely/code/my-project/node_modules/miniflare/dist/src/index.js:3692:26)
at CacheRouter.put (/Users/grantkiely/code/my-project/node_modules/miniflare/dist/src/index.js:4880:41)
at CacheRouter.route (/Users/grantkiely/code/my-project/node_modules/miniflare/dist/src/index.js:3822:27)
at #handleLoopbackPlugins (/Users/grantkiely/code/my-project/node_modules/miniflare/dist/src/index.js:8919:54)
at #handleLoopback (/Users/grantkiely/code/my-project/node_modules/miniflare/dist/src/index.js:8988:53)
at Server.emit (node:events:523:35)

Additional information

Related: #2130

If you need a repro I can set one up.

@gkiely gkiely added the bug Something isn't working label Jun 4, 2023
@gkiely gkiely changed the title Error: Could not locate the bindings file. Error: Could not locate the bindings file (wrangler) Jun 4, 2023
@Jarred-Sumner
Copy link
Collaborator

This will be fixed by #2073 which @alexlamsl is working on

@gkiely
Copy link
Author

gkiely commented Jun 4, 2023

Cool I'll close and retest after that ticket is done.

@gkiely gkiely closed this as completed Jun 4, 2023
@gkiely
Copy link
Author

gkiely commented Jun 30, 2023

@Jarred-Sumner Just a heads up I'm still seeing this error in the canary build. I can setup a minimal repro if that would be helpful.

@gkiely gkiely reopened this Jun 30, 2023
@urgobalt
Copy link

I have encountered the same error, and the fix I have found is to go into better-sqlite3 and manually run the node script called install. Other package managers, such as yarn, seem to run this script during the installation phase, while bun does not.

@gkiely
Copy link
Author

gkiely commented Sep 8, 2023

I have encountered the same error, and the fix I have found is to go into better-sqlite3 and manually run the node script called install. Other package managers, such as yarn, seem to run this script during the installation phase, while bun does not.

I couldn't get that working with:

"wrangler": "^3.7.0",
"better-sqlite3": "^8.6.0",

@ukd1
Copy link

ukd1 commented Sep 9, 2023

I'm also hitting this issue

@essential-randomness
Copy link

Likewise, with the latest better-sqlite3 (8.6.0) but no wrangler.

@bndkt
Copy link

bndkt commented Sep 12, 2023

For me this issue is resolved when adding

"trustedDependencies": [
    "better-sqlite3"
  ]

to package.json and re-installing dependencies. Notice that you need to add better-sqlite3, not wrangler to trustedDependencies.

@essential-randomness
Copy link

For me this issue is resolved when adding

"trustedDependencies": [
    "better-sqlite3"
  ]

to package.json and re-installing dependencies. Notice that you need to add better-sqlite3, not wrangler to trustedDependencies.

I tried this, but also had to bun add node-gyp afterwards to solve a "No prebuilt binaries found (target=19.9.0 runtime=node arch=x64 libc= platform=darwin)" error. Then better-sqlite3 did run its own installer during bun install.

Unfortunately, once I go run the code i get:

$ bun run --watch src/index.ts
dyld[92161]: missing symbol called

@ukd1
Copy link

ukd1 commented Sep 17, 2023

I'm also hitting this issue

cloudflare/workers-sdk#3964 - I figured out what it was for me; a simple nuking and reinstalling fixed using npm install

@gkiely
Copy link
Author

gkiely commented Dec 2, 2023

This has been resolved for me as of 1.0.15

@gkiely gkiely closed this as completed Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants