question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

package that uses buffer as dependency fails

See original GitHub issue

Error

[mf:err] MiniflareError: Unable to resolve "dist/index.mjs" dependency "buffer": no matching module rules
[mf:err] MiniflareError: Unable to resolve "dist/index.mjs" dependency "buffer": no matching module rules
    at ScriptLinker._linker (/home/wighawag/dev/wighawag/etherplay/conquest-agent-service/node_modules/miniflare/src/scripts.ts:126:13)
    at ModuleWrap.<anonymous> (internal/vm/module.js:321:30)
    at SourceTextModule.<computed> (internal/vm/module.js:320:36)
    at SourceTextModule.link (internal/vm/module.js:198:22)
    at ScriptBlueprint.buildModule (/home/wighawag/dev/wighawag/etherplay/conquest-agent-service/node_modules/miniflare/src/scripts.ts:42:18)
    at Miniflare._Miniflare_reloadWorker (/home/wighawag/dev/wighawag/etherplay/conquest-agent-service/node_modules/miniflare/src/index.ts:180:26)
    at Miniflare._Miniflare_watchCallback (/home/wighawag/dev/wighawag/etherplay/conquest-agent-service/node_modules/miniflare/src/index.ts:124:29)
    at OptionsWatcher._init (/home/wighawag/dev/wighawag/etherplay/conquest-agent-service/node_modules/miniflare/src/options/watcher.ts:100:16)
    at Miniflare.getOptions (/home/wighawag/dev/wighawag/etherplay/conquest-agent-service/node_modules/miniflare/src/index.ts:292:5)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
janat08commented, Sep 24, 2021

close?

0reactions
janat08commented, Jan 18, 2022

Hey! 👋 It looks like you’re trying to import an npm module without a build-step. Workers only natively support modules that are located in your upload directory, not node_modules. Check out https://miniflare.dev/recipes/esbuild.html for an example of using esbuild to bundle your code first. Let me know if you have any issues with this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Unable to resolve module `buffer` React Native
First Install the missing dependency buffer : npm install buffer --save OR yarn add buffer. Second. Up in the top of your file...
Read more >
Module not found: Can't resolve 'buffer' error [Solved]
The error "Module not found: Error: Can't resolve 'buffer'" occurs because there has been a breaking change in Webpack version 5. To solve...
Read more >
buffer - npm
Start using buffer in your project by running `npm i buffer`. ... buffer. TypeScript icon, indicating that this package has built-in type ...
Read more >
Overview | Protocol Buffers - Google Developers
Protocol buffers provide a language-neutral, platform-neutral, extensible mechanism for serializing structured data in a forward-compatible ...
Read more >
Best practices for working with AWS Lambda functions
To have full control of the dependencies your function uses, package all of ... In the case of CreateFunction, AWS Lambda will fail...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found