score:2
as pointed out in a comment, bigint is a new feature.you cannot use bigint while you have the target property in tsconfig.json in a value other than esnext.but you shouldn’t do this because there is little browser support developer.mozilla.org and caniuse.com.
score:-1
try using const thebiggestint = bigint(9007199254740991);
instead. i found out about this here: https://github.com/facebook/create-react-app/issues/6907
the 9007199254740991n syntax is very new and isn't supported by create-react-app yet.
edit: as pointed out in the comments below this answer bigint(9007199254740991) is just alternative syntax for 9007199254740991n so this will not help you. see https://developer.mozilla.org/en-us/docs/web/javascript/reference/global_objects/bigint for more details.
perhaps try using https://www.npmjs.com/package/big-integer instead. it uses bigint when it is available in a browser and when it isn't it acts as a polyfill.
score:4
bigint
is enabled in node_modules/typescript/lib/lib.es2020.bigint.d.ts
, so it is part of es2020
not part of esnext
.
however, it seems that the ***n
lexical expression is not part of lib.es2020.bigint.d.ts
. indeed, that is enabled by esnext
.
to enable typescript use with bigint
but without ****n
lexical expressions, this configuration worked:
{
"compileroptions": {
"lib": [
"es2020"
],
"module": "commonjs",
"target": "es2020",
}
adding "esnext" to the libs:
{
"compileroptions": {
"lib": [
"es2020", "esnext"
],
"module": "commonjs",
"target": "es2020",
}
then enables(*) the ability to '****n' lexical expressions.
(*) another separate issue is that vscode (if you are working with that) will sometimes opaquely enable '****n' as a valid expression, even when 'esnext' is never explicitly mentioned in the relevant tsconfig.json
file. perhaps it is enabling esnext
implicitly? that behavior is actually not helpful when trying to figure exactly what settings enable the ***n
lexical expressions - after adding esnext
to a tsconfig file and then removing it, the abilty to use ****n
expressions continued anyway.
Source: stackoverflow.com
Related Query
- "BigInt literals are not available when targeting lower than ESNext"
- input tag in react not letting enter more than one character when array of inputs are rendered in a loop
- Api call with timer not firing when props are updating faster than timer is set for
- React.js: Refs are not available on initial render
- Objects are not valid as a React child getting error when adding div?
- Redux not updating components when deep Immutable state properties are updated
- BackAndroid/BackHandler Event Listeners are not Triggered when set in a Modal's Child Component
- MaterialUI Compoent does not AutoComplete when data is available
- Routes are not navigating when React v15.5 setup with react-redux v5 is
- AG-Grid React, trouble getting custom cell renderer to update when data changes. Function components are behaving differently than class components
- When using onChange with React, spaces are not registered
- Stats for child components are not always available in User-Timing section of chrome performance tab
- Invariant Violation: Objects are not valid as a React child when firing a function
- Apollo reactive variable are not working when imported into another file! Why?
- Why are my props not being passed into my component when mount rendering?
- Interact with a DOM element when 'ref' is not available
- Preact error: "objects are not valid as a child. Encountered an object with the keys {}" when using async await in root component
- Landscape setting in Chrome is not available when using ReactToPrint
- Styled-components: Styles are not applied when trying to style already styled component
- action creators not available as functions in props when passed directly to connect
- Default props are not available in first time render ReactJS
- Arguments are not passing from component to actions when using redux-saga
- How to select nodes for Enzyme testing when class names are not static?
- React.memo is not available when working with Typescript?
- React Router v6 redirect when there are not any url queryString parameters
- Objects are not valid as a React child when trying to map
- Objects are not valid as a React child error when giving value to react-select
- Images imported into VSCode are not showing when portfolio site deployed with Netlify
- Why, in React, do children not re-render when parent component re-renders(children are not wrapped by React.memo)?
- Zeit Now routing problem. 404 NOT FOUND when reloading pages other than index page
More Query from same tag
- How to write test cases to cover all the nested 'then' callbacks in a promise chain
- How Can I render a list dynamically using react-calendar?
- Change ant design radio input on focus
- Node JS : JSON Refactoring based on the city
- Ckeditor dialogs input field disabled when editor itself placed in modal
- How to scale label size radar chart chart.js
- User input not affecting border radius correctly
- show the seats from an object array Reactjs
- React - How to show skeleton placeholders until Array map function ended
- How to correctly infer React props from as prop with generic overload
- How could I write this function so it doesn't setState within the foreach everytime
- React JSX Syntax
- How to store the result of query from createApi in a slice?
- Getting a value of inputs populated Dynamically React.js
- How to replace jsx substring of a props - react
- Dynamic lookup from React's state in material-table
- React-Select with React-Apollo does not work
- React-router: nested routes error
- Render bar chart with chart.js and react and es6
- Fetch method works outside a function but doesn't work inside a function
- Change the style KeyboardDatePicker Material UI component
- How to Use URL Parameters and Query Strings With React Router
- How to hide html video controls for Safari Mobile
- React using defaultProptypes and propTypes check, with undefined prop
- How to Apply maxLength to editable div using react?
- Redux does not update the view after the reducer
- Override margin in Separator Component of Fluent UI using React
- Showing 'undefined%' in the graph if data does not exist
- How to use write ternary operator for click event in React.js
- React Typescript: Element implicitly has an 'any' type because type has no index signature