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

Skipped array elements cause a crash #65

Open
maxpatiiuk opened this issue Feb 25, 2025 · 0 comments
Open

Skipped array elements cause a crash #65

maxpatiiuk opened this issue Feb 25, 2025 · 0 comments

Comments

@maxpatiiuk
Copy link

Fails on the following code:

var [, s] = await [1, 2];
error during build:
[vite-plugin-top-level-await] Cannot read properties of null (reading 'type')
    at /Users/mak13180/site/esri/arcgis-web-components-4/node_modules/vite-plugin-top-level-await/dist/utils/resolve-pattern.js:22:26
    at Array.flatMap (<anonymous>)
    at resolvePattern (/Users/mak13180/site/esri/arcgis-web-components-4/node_modules/vite-plugin-top-level-await/dist/utils/resolve-pattern.js:21:37)
    at /Users/mak13180/site/esri/arcgis-web-components-4/node_modules/vite-plugin-top-level-await/dist/transform.js:170:106
    at Array.flatMap (<anonymous>)
    at /Users/mak13180/site/esri/arcgis-web-components-4/node_modules/vite-plugin-top-level-await/dist/transform.js:170:53
    at Array.flatMap (<anonymous>)
    at transformModule (/Users/mak13180/site/esri/arcgis-web-components-4/node_modules/vite-plugin-top-level-await/dist/transform.js:168:50)
    at /Users/mak13180/site/esri/arcgis-web-components-4/node_modules/vite-plugin-top-level-await/dist/index.js:118:64
    at Array.map (<anonymous>)

Here:

if (elem.type === "RestElement") {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant