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

Cannot find type definition file for 'core-js' #1186

Closed
chpasha opened this issue Nov 2, 2016 · 25 comments
Closed

Cannot find type definition file for 'core-js' #1186

chpasha opened this issue Nov 2, 2016 · 25 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@chpasha
Copy link

chpasha commented Nov 2, 2016

I'm getting this error since RC-1 for autocomplete, calendar, api and dropdown. Using angular-cli beta 18 with webpack + angular 2.1.2
Tried to install @type/core-js but it brings even more errors

@cacogr
Copy link

cacogr commented Nov 2, 2016

Same here. It also happens just running tsc on a project that imports primeng.

node_modules/primeng/components/autocomplete/autocomplete.d.ts(1,1): error TS2688: Cannot find type definition file for 'core-js'.                          
node_modules/primeng/components/calendar/calendar.d.ts(1,1): error TS2688: Cannot find type definition file for 'core-js'.                                  
node_modules/primeng/components/checkbox/checkbox.d.ts(1,1): error TS2688: Cannot find type definition file for 'core-js'.                                  
node_modules/primeng/components/common/api.d.ts(1,1): error TS2688: Cannot find type definition file for 'core-js'.                                         
node_modules/primeng/components/dropdown/dropdown.d.ts(1,1): error TS2688: Cannot find type definition file for 'core-js'.                                  
node_modules/primeng/components/editor/editor.d.ts(1,1): error TS2688: Cannot find type definition file for 'core-js'.                                      
node_modules/primeng/components/inputmask/inputmask.d.ts(1,1): error TS2688: Cannot find type definition file for 'core-js'.                                
node_modules/primeng/components/inputswitch/inputswitch.d.ts(1,1): error TS2688: Cannot find type definition file for 'core-js'.                            
node_modules/primeng/components/listbox/listbox.d.ts(1,1): error TS2688: Cannot find type definition file for 'core-js'.                                    
node_modules/primeng/components/multiselect/multiselect.d.ts(1,1): error TS2688: Cannot find type definition file for 'core-js'.                            
node_modules/primeng/components/radiobutton/radiobutton.d.ts(1,1): error TS2688: Cannot find type definition file for 'core-js'.                            
node_modules/primeng/components/rating/rating.d.ts(1,1): error TS2688: Cannot find type definition file for 'core-js'.                                      
node_modules/primeng/components/schedule/schedule.d.ts(1,1): error TS2688: Cannot find type definition file for 'core-js'.                                  
node_modules/primeng/components/selectbutton/selectbutton.d.ts(1,1): error TS2688: Cannot find type definition file for 'core-js'.                          
node_modules/primeng/components/slider/slider.d.ts(1,1): error TS2688: Cannot find type definition file for 'core-js'.                                      
node_modules/primeng/components/spinner/spinner.d.ts(1,1): error TS2688: Cannot find type definition file for 'core-js'.                                    
node_modules/primeng/components/togglebutton/togglebutton.d.ts(1,1): error TS2688: Cannot find type definition file for 'core-js'.                          
node_modules/primeng/components/tristatecheckbox/tristatecheckbox.d.ts(1,1): error TS2688: Cannot find type definition file for 'core-js'. 

Those files have /// <reference types="core-js" /> in the first line. Manually removing those lines, that were not there in beta.20, reveals another problem in the browser console:

Error: (SystemJS) Unexpected token <
    SyntaxError: Unexpected token <
        at eval (<anonymous>)
    Evaluating http://localhost:3000/traceur
    Error loading http://localhost:3000/traceur
    Unable to load transpiler to transpile http://localhost:3000/node_modules/primeng/components/common/api.js
    Error loading http://localhost:3000/node_modules/primeng/components/common/api.js as "./components/common/api" from http://localhost:3000/node_modules/primeng/primeng.js
        at eval (<anonymous>)
    Evaluating http://localhost:3000/traceur
    Error loading http://localhost:3000/traceur
    Unable to load transpiler to transpile http://localhost:3000/node_modules/primeng/components/common/api.js
    Error loading http://localhost:3000/node_modules/primeng/components/common/api.js as "./components/common/api" from http://localhost:3000/node_modules/primeng/primeng.js

@bmazaheri
Copy link

bmazaheri commented Nov 2, 2016

same occurs for me after upgrade to rc-1 version (angular 2.1.2):

ERROR in node_modules\primeng\components\tristatecheckbox\tristatecheckbox.d.ts
(1,1): error TS2688: Cannot find type definition file for 'core-js'.
ERROR in node_modules\primeng\components\togglebutton\togglebutton.d.ts
(1,1): error TS2688: Cannot find type definition file for 'core-js'.
ERROR in node_modules\primeng\components\spinner\spinner.d.ts
(1,1): error TS2688: Cannot find type definition file for 'core-js'.
ERROR in node_modules\primeng\components\slider\slider.d.ts
(1,1): error TS2688: Cannot find type definition file for 'core-js'.
ERROR in node_modules\primeng\components\selectbutton\selectbutton.d.ts
(1,1): error TS2688: Cannot find type definition file for 'core-js'.
ERROR in node_modules\primeng\components\schedule\schedule.d.ts
(1,1): error TS2688: Cannot find type definition file for 'core-js'.
ERROR in node_modules\primeng\components\rating\rating.d.ts
(1,1): error TS2688: Cannot find type definition file for 'core-js'.
ERROR in node_modules\primeng\components\radiobutton\radiobutton.d.ts
(1,1): error TS2688: Cannot find type definition file for 'core-js'.
ERROR in node_modules\primeng\components\multiselect\multiselect.d.ts
(1,1): error TS2688: Cannot find type definition file for 'core-js'.
ERROR in node_modules\primeng\components\listbox\listbox.d.ts
(1,1): error TS2688: Cannot find type definition file for 'core-js'.
ERROR in node_modules\primeng\components\inputswitch\inputswitch.d.ts
(1,1): error TS2688: Cannot find type definition file for 'core-js'.
ERROR in node_modules\primeng\components\inputmask\inputmask.d.ts
(1,1): error TS2688: Cannot find type definition file for 'core-js'.
ERROR in node_modules\primeng\components\editor\editor.d.ts
(1,1): error TS2688: Cannot find type definition file for 'core-js'.
ERROR in node_modules\primeng\components\dropdown\dropdown.d.ts
(1,1): error TS2688: Cannot find type definition file for 'core-js'.
ERROR in node_modules\primeng\components\checkbox\checkbox.d.ts
(1,1): error TS2688: Cannot find type definition file for 'core-js'.
ERROR in node_modules\primeng\components\calendar\calendar.d.ts
(1,1): error TS2688: Cannot find type definition file for 'core-js'.
ERROR in node_modules\primeng\components\autocomplete\autocomplete.d.ts
(1,1): error TS2688: Cannot find type definition file for 'core-js'.
ERROR in node_modules\primeng\components\common\api.d.ts
(1,1): error TS2688: Cannot find type definition file for 'core-js'.

@johanssonfredrik
Copy link

Same for me. My error only occurs on bail.

94% asset optimizationError in bail mode: [default] /Volumes/nyps2020-CaseSensitive/nyps2020/appl/fe.appl/admin.fe.appl/node_modules/primeng/components/autocomplete/autocomplete.d.ts:1:0
[ERROR] Cannot find type definition file for 'core-js'.

@phil-rbn
Copy link

phil-rbn commented Nov 2, 2016

Same problem here.

Pinning version to "primeng": "1.0.0-beta.19" in package.json helped deploying successfully again ;-)

@cagataycivici
Copy link
Member

Do you have core-js type at your package.json devDependencies?

  "devDependencies": {
      "@types/core-js": "^0.9.34",
      "@types/node": "^6.0.45",

@mrgoos
Copy link

mrgoos commented Nov 2, 2016

@cagataycivici - it won't help, tried it.

@gamferreira
Copy link

I am facing similar issue, my package.json contains:

"devDependencies": {
"@types/core-js": "^0.9.34",
"@types/node": "^6.0.45",

I was getting " Duplicate identifier 'PropertyKey'. "

As suggested by @philip-spark5 I moved to "primeng": "1.0.0-beta.19" and the problem was solved

@gamferreira
Copy link

gamferreira commented Nov 2, 2016

@cagataycivici yesterday everything was running fine. Not sure why (and what) something has changed here and primefaces stopped working . I know moving to beta.19 is not a solution but there is certainly something different on this beta version that fixes the duplication.

@mrgoos
Copy link

mrgoos commented Nov 2, 2016

@cagataycivici It also works well in beta.20 BTW.

@FallenRiteMonk
Copy link
Contributor

@cagataycivici angular-cli might help to replicate as i have this issue using it.
And maybe #1191 is related to this issue

@svideau
Copy link

svideau commented Nov 2, 2016

same here, beta 20 is ok and adding "@types/core-js": "^0.9.34" do not solve the issue with RC1.

@cacogr
Copy link

cacogr commented Nov 2, 2016

This looks like a similar issue angular/in-memory-web-api#62

@mrgoos
Copy link

mrgoos commented Nov 2, 2016

@FallenRiteMonk - I got it configured to "lib": ["es6", "dom"], and it still doesn't work.

@cagataycivici
Copy link
Member

cagataycivici commented Nov 2, 2016

We've upgraded to typescript 2 and it seems compiler adds;

/// <reference types="core-js" />

To many d.ts files in primeng package causing this error. We're open to suggestions. Note that this is not added to all d.ts files but the ones where we use something like Function, Event, MouseEvent or similar that causes a reference to core-js.

As a quick workaround, add no resolve when compiling.

tsc --noResolve

@cacogr
Copy link

cacogr commented Nov 2, 2016

@cagataycivici Have you tried compiling primeng with "lib": ["es6", "dom"] in tsconfig.json and not using core-js?

@mrgoos
Copy link

mrgoos commented Nov 2, 2016

@cacogr - This is my exact configuration where it reproduces.

@cagataycivici
Copy link
Member

@cacogr , good coincidence, we were trying the same thing and it worked, the generated d.ts files do not have the core-js reference anymore. We're checking and will do RC2 as this turned out to be a common issue.

@cacogr
Copy link

cacogr commented Nov 2, 2016

@mrgoos I mean in primeng's own tsconfig, not in an app that uses primeng.

@cagataycivici nice!

@mrgoos
Copy link

mrgoos commented Nov 2, 2016

@cacogr - I see, great thanks! 👍

@cagataycivici cagataycivici added this to the 1.0.0-RC2 milestone Nov 2, 2016
@cagataycivici cagataycivici added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Nov 2, 2016
@cagataycivici cagataycivici self-assigned this Nov 2, 2016
@cagataycivici
Copy link
Member

Try with 1.0.0.RC2 please.

@gamferreira
Copy link

Changed to 1.0.0-rc.2 resolved all issues. Thanks !

@mrgoos
Copy link

mrgoos commented Nov 2, 2016

It is working, no errors 😄
Thanks.

@johanssonfredrik
Copy link

Works for me too! Thanks!

@cagataycivici
Copy link
Member

Awesome, thanks for the feedback guys.

@cagataycivici
Copy link
Member

Looks like we're having an RC (release crisis). Please try with RC3, RC2 fixes the core-js issue but published the modules as es2015, which should be commonjs. Hopefully RC3 brings back the order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

10 participants