Skip to content

wrangler publish fails when ESModule is used #252

@Kynson

Description

@Kynson

Hello,

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.

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions