I am trying to run Webpack on a project and I am getting multiple errors
node_modules/@types/core-js/index.d.ts
error TS2304: Cannot find name 'PropertyKey'.
...
node_modules/@types/core-js/index.d.ts
error TS2339: Property 'for' does not exist on type 'SymbolConstructor'.
I should have all my typings installed so I am not sure where these are coming from. I tried copying over a package.json from a project that compiles but it didn't help. What am I missing?
My tsconfig looks like this
{
"compilerOptions": {
"target": "es5",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"noImplicitAny": false,
"suppressImplicitAnyIndexErrors": true
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules",
"**/*.spec.ts"
]
}
I am getting the same kind of errors with @types/core-js at 0.9.35
Could be something else..
EDIT
There has been some changes on the repo last week. You can read the issue on github and see the changes via these links:
https://github.com/DefinitelyTyped/DefinitelyTyped/issues/15104
https://github.com/DefinitelyTyped/DefinitelyTyped/pull/15108/commits/f2c5c990e448550fcebec071c25e6a1e5766dde7
My solution was to change
"lib": ["es5", "dom"]
to "lib": ["es6", "dom"]
in the compilerOptions
object in my tsconfig files.
By doing this I made the errors disappear without downgrading to 0.9.35
Note: You dont need to change the target (mine is still es5)
For me the answer was...
"compilerOptions": {
...
"lib": [
"es2016",
"dom"
]
},
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With