videogular2: Cannot find type definition file for 'core-js'
Description
Running Videogular 2 in Ionic 2
Expected Behavior
I’m expecting it to run without these errors
Actual Behavior
When following the getting started guide and attempting to run the app, I get the following errors:
node_modules/videogular2/src/core/services/vg-api.d.ts(1,1): error TS2688: Cannot find type definition file for 'core-js'.
node_modules/videogular2/src/core/vg-media/i-playable.d.ts(1,1): error TS2688: Cannot find type definition file for 'core-js'.
Steps to Reproduce
- Initialize Ionic v2 project
- Follow getting started guide to import Videogular
- Run app
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 17 (3 by maintainers)
npm install @types/core-js --save-devwill solve your problem.
In the end I solved this for me with: npm install --save @types/core-js
In package.json:
and in tsconfig.json
Cheers
@Elecash Hmm… Thanks, but that didn’t help. Actually, I just went into the
vg-api.dandi-playable.dtypings and deleted :/// <reference types="core-js" />which fixed it. Seems like a hack, but I’m not sure what else to doInstalling
core-jsbreaks when using alibdefinition bigger thanes2015cause of duplicate symbols:I think as long as this project depends on
core-jsthe best solution is to patch the type definitions after installation. We use the followingpostinstallscript to strip out thecore-jsdefinition.This script simply removes the first line from the
.d.tsfiles.