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

TS1011: An element access expression should take an argument #4144

Open
igor-spirin-indriver opened this issue Mar 16, 2025 · 1 comment
Open
Labels
Bug Something isn't working

Comments

@igor-spirin-indriver
Copy link

Description

After upgrading from v2.9.2 to v2.10.1 my project broke due to TypeScript error so I had to roll back.

TS1011: An element access expression should take an argument

To Reproduce

Here the test app code to reproduce:

package main

type Foo struct {
	Total int64            `json:"total"`
	List  map[string][]Bar `json:"list,omitempty"`
}

type Bar struct {
	Name string `json:"name"`
}

func (a *App) Issue() *Foo {
	return nil
}

func (a *App) GetLostModelsForVersion2_9_2() *Bar {
	return nil
}

The problem is in map[string][]Bar

Expected behaviour

Succesful build

Screenshots

Image

Attempted Fixes

No response

System Details

# Wails
Version | v2.10.1


# System
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
| OS           | MacOS                                                                                                                       |
| Version      | 14.6.1                                                                                                                      |
| ID           | 23G93                                                                                                                       |
| Go Version   | go1.23.6                                                                                                                    |
| Platform     | darwin                                                                                                                      |
| Architecture | arm64                                                                                                                       |
| CPU 1        | Apple M1 Pro                                                                                                                |
| CPU 2        | Apple M1 Pro                                                                                                                |
| GPU          | Chipset Model: Apple M1 Pro Type: GPU Bus: Built-In Total Number of Cores: 16 Vendor: Apple (0x106b) Metal Support: Metal 3 |
| Memory       | 16GB                                                                                                                        |
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

# Dependencies
┌─────────────────────────────────────────────────────────────────────┐
| Dependency                | Package Name | Status    | Version      |
| Xcode command line tools  | N/A          | Installed | 2408         |
| Nodejs                    | N/A          | Installed | 22.13.0      |
| npm                       | N/A          | Installed | 11.0.0       |
| *Xcode                    | N/A          | Installed | 16.1 (16B40) |
| *upx                      | N/A          | Available |              |
| *nsis                     | N/A          | Available |              |
|                                                                     |
└────────────────────── * - Optional Dependency ──────────────────────┘

# Diagnosis
Optional package(s) installation details: 
  - upx : Available at https://upx.github.io/
  - nsis : More info at https://wails.io/docs/guides/windows-installer/

 SUCCESS  Your system is ready for Wails development!

Additional context

No response

@igor-spirin-indriver igor-spirin-indriver added the Bug Something isn't working label Mar 16, 2025
@joshuapare
Copy link

I've fixed this locally by changing the renderer to use the Array<type> primitive instead of the postfix []. Happened to me as well under same scenario, it's working now. Looks to be a slight regression from this work: #3978

If you want to assign this to me I can take the ticket

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants