Can't create Record<Id, any>
See original GitHub issueExpected Behavior
Since Id
objects are just strings, I should be able to create a Record
using Id
s as keys.
Actual Behavior
I get the following error:
Type 'Id<Creep>' does not satisfy the constraint 'string | number | symbol'.
Type 'Id<Creep>' is not assignable to type 'string'.
Sample code (if available)
var data: Record<Id<Creep>, number> = {};
Your Environment
- Node.js version: 12.13.0
- TypeScript version: 3.6.4
- {
typed-screeps
or@types/screeps
delete as appropriate} version: https://github.com/screepers/typed-screeps/commit/be96ea9f377dadf00fbddf430f88e44ee01e64b8
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
LWC create record - getting 'undefined' for record.id in 'then'
Taking a look at Create a Record documentation, the field's values are returned in the fields attribute and that every field in that...
Read more >You cannot create a field that references the Record ID field ...
I have a formula field that concatenates a few different fields into 1 value, one of which is the record ID.
Read more >Flow: How To Use Record Id - Salesforce Flowsome!
During the Salesforce releases in 2020, there are more intuitive ways to achieve this by using “RecordId” variable. A variable: with any name,...
Read more >Flow Builder Get Contact ID of record created during Flow ...
I want to get the ID of the Contact just created and reference it on a Lookup on the original Contact record. Any...
Read more >can not create Record. Error: missing Employees record ID
Hi all,. I am new in Appgywer, I am learning follow the official tutorial. But I got stuck in Topic: Data → creating...
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
I don’t know what’s the use case, but
const data = new Map<Id<Creep>, number>()
may also be an option.Cast to string or number as index types can only be
string | number | symbol
types.