miniflare throws SyntaxError with module format worker configuration but works with wrangler
See original GitHub issueHi,
I setup a module format worker using esbuild, and got it working using wrangler. However when I went to setup tests using miniflare the exact same configuration throws an error:
SyntaxError: Unexpected token 'export'
I have been bashing my head against it for a while, but cannot work out what the issue is. I created a minimal test repo to show the issue: https://github.com/autotelic/esm-wrangler-miniflare.git
All help gratefully received!
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Conflict in wrangler.toml between miniflare and ... - GitHub
When using esbuild everything works in miniflare just fine, but when ... to Workers Docs field main is supported in modules format (beta...
Read more >Using the CLI - Miniflare
If you're using an ES module format worker, bindings will be accessible via the env global variable. The REPL can be configured using ......
Read more >Doubling down on local development with Workers: Miniflare ...
We want all developers to be able to take advantage of the improved local experience, so we're making it easy to start a...
Read more >Miniflare 2.0: fully-local development and testing for Workers
I wanted a magical simulator that would just work ✨ in existing projects, focusing on the developer experience, and — by the reception...
Read more >Integrate Remix with Cloudflare Pages - Jacob Paris
Wrangler is the CLI for working with Cloudflare Workers. ... but they use a setup function so that you don't have to import...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
worked perfectly 😄 thanks so much @mrbbot (and also for everything you’ve done in developing miniflare, an amazing tool!)
Hey! 👋 Unlike Wrangler 2, Miniflare isn’t able to auto-detect you’re using a module format worker. You’ll need to add the
--modules
flag to yourminiflare
package.json
script. Miniflare also doesn’t support themain
field inwrangler.toml
, but will read your main module from themodule
field inpackage.json
(like Wrangler 1).