wrangler publish fails when ESModule is used
See original GitHub issueHello,
I got this error when publishing my ESModule project: Cannot read properties of undefined (reading '1')
I reproduce the issue with the following files:
test.js
import './another.js'
console.log('This is a test')
another.js
console.log('This is another module')
wragnler.toml
name = 'test'
type = 'javascript'
account_id = '<ACCOUNT_ID>'
zone_id = '<ZONE_ID>'
compatibility_date = '2021-11-10'
[build.upload]
format = 'modules'
main = './test.js'
And then run npx wrangler@beta publish
The issue does not exist if another.js
is not imported. I am not sure this is a bug or it is because v2 is still in beta and ESModule is not yet supported
Thank you.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Deprecations · Cloudflare Workers docs
Deprecations. This document describes the difference between Wrangler 1 and 2, specifically deprecations and breaking changes.
Read more >getting an error while publish the on cloudflare workers?
As the error says, you need to run wrangler login or wrangler config to set the credentials for your account.
Read more >@cloudflare/wrangler | Yarn - Package Manager
init. Creates a skeleton wrangler.toml in an existing directory. This can be used as an alternative to generate if you prefer to clone...
Read more >Building a Full-Stack Serverless Application with Cloudflare ...
When you publish a project to Cloudflare Workers, ... Once you've installed Wrangler, you can use the generate command to make a new...
Read more >Cloudflare Workers Sites and GitHub Actions - Sam Rhea
I used Cloudflare Access and Wrangler to build a deployment pipeline that could publish a staging version of the site that was only...
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
wow awesome! Worked great - thanks a million
You can work around this by providing the entry-point script at the command line: