components icon indicating copy to clipboard operation
components copied to clipboard

Plunkers not working for md-data-table examples

Open gseabrook opened this issue 9 years ago • 20 comments

The plunker examples for all the md-data-tables are not working, I receive the following error

(SystemJS) XHR error (404) loading https://run.plnkr.co/sdILEjRNoLe9paJ1/@angular/cdk.ts

Try following any of the plunker links on

https://material.angular.io/components/table/overview

gseabrook avatar Jul 07 '17 07:07 gseabrook

Adding

'@angular/cdk': 'https://unpkg.com/@angular/cdk/bundles/cdk.umd.js',

to the Systemjs.config.js solves the 404.

But there is another error. After adding the wrong reference:

Unhandled Promise rejection: Template parse errors: Can't bind to 'cdkHeaderRowDef' since it isn't a known property of 'md-header-row'.

  1. If 'md-header-row' is an Angular component and it has 'cdkHeaderRowDef' input, then verify that it is part of this module.

  2. If 'md-header-row' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

  3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("

    <md-header-row [ERROR ->]*cdkHeaderRowDef="displayedColumns"> <md-row *cdkRowDef="let row; columns: displ"): ng:///table-basic-example.html@32:19 Property binding cdkHeaderRowDef not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the "@NgModule.declarations". ("

    [ERROR ->]<md-header-row *cdkHeaderRowDef="displayedColumns"> <md-row *cdkRowDef="let row;"): ng:///table-basic-example.html@32:4

Hypopheralcus avatar Jul 07 '17 12:07 Hypopheralcus

Adding import { CdkTableModule } from '@angular/cdk'; to main.ts and add CdkTableModule to the imports solves the problem.

imports: [
    BrowserModule,
    BrowserAnimationsModule,
    FormsModule,
    HttpModule,
    CdkTableModule,
    MaterialModule,
    MdNativeDateModule,
    ReactiveFormsModule,
  ],

Hypopheralcus avatar Jul 07 '17 12:07 Hypopheralcus

Here is a working plunker version https://plnkr.co/edit/nASMWAJxt3epEwptV4mp?

Hypopheralcus avatar Jul 07 '17 12:07 Hypopheralcus

Wow, the examples are really hard to follow. Can you create a plunker that shows retrieving data from a JSON API with paging? I'd imagine that's a much more common use case than reading all of the possible data when the page loads as these examples seem to do.

ScottRFrost avatar Jul 07 '17 12:07 ScottRFrost

This seems to be affecting multiple plunkr examples (maybe all?)

At least md-select has the cdk error, and the md-button example (any many others) from the overview tab are getting other 404 errors. Not sure how many others.

EDIT

Same with the progress spinner example:

Failed to load resource: the server responded with a status of 404 (Not Found)

Error: (SystemJS) Invalid or unexpected token SyntaxError: Invalid or unexpected token

Refused to execute script from 'https://slack.sp1.convertro.com/view/vt/v1/slack/0/cvo.gif?cvosrc=display.a…tm_source=adroll&utm_medium=display&utm_content=323368180&utm_campaign=wwh' because its MIME type ('image/gif') is not executable.

Looks like in addition to having issues loading cdk.ts (adding it as instructed above fixes that error), it's having issues loading platform-browser:

Error loading https://unpkg.com/@angular/platform-browser/bundles/platform-browser.umd.js as "@angular/platform-browser" from https://run.plnkr.co/BT3WAmHpCIXT4GAK/main.ts

LilSebastian5000 avatar Jul 07 '17 14:07 LilSebastian5000

@Hypopheralcus Your 'working' example doesn't load for me, it's getting that "Error loading https://unpkg.com/@angular/platform-browser/bundles/platform-browser.umd.js as "@angular/platform-browser" from https://run.plnkr.co/BT3WAmHpCIXT4GAK/main.ts" error.

LilSebastian5000 avatar Jul 07 '17 14:07 LilSebastian5000

@ryanpm40 Your plunker link doesn't work. My version is still working.

Hypopheralcus avatar Jul 07 '17 15:07 Hypopheralcus

@Hypopheralcus The error I provided was from your plunkr link (https://plnkr.co/edit/nASMWAJxt3epEwptV4mp), I clicked the one you posted, and that's the error I received.

However, it seems to have resolved now. Maybe there was some strange downtime with https://unpkg.com at the time, thanks!

LilSebastian5000 avatar Jul 07 '17 15:07 LilSebastian5000

They should all be fixed now.

jelbourn avatar Jul 07 '17 16:07 jelbourn

@jelbourn

They are still not working. Please see the plunker linked on the Overview tab of DatePicker. Errors are:

Failed to load resource: the server responded with a status of 404 (Not Found) zone.min.js:1 Error: (SystemJS) Invalid or unexpected token SyntaxError: Invalid or unexpected token at eval (<anonymous>) at e.invoke (https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.8.5/zone.min.js:1:19922) at t.run (https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.8.5/zone.min.js:1:15134) at https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.8.5/zone.min.js:1:12167 at e.invokeTask (https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.8.5/zone.min.js:1:20606) at t.runTask (https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.8.5/zone.min.js:1:15783) at i (https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.8.5/zone.min.js:1:10706) at XMLHttpRequest.invoke (https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.8.5/zone.min.js:1:21603) Evaluating https://unpkg.com/@angular/platform-browser/bundles/platform-browser.umd.js Error loading https://unpkg.com/@angular/platform-browser/bundles/platform-browser.umd.js as "@angular/platform-browser" from https://run.plnkr.co/M8n19lwO8hX8EWKh/main.ts at eval (<anonymous>) at e.invoke (https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.8.5/zone.min.js:1:19922) at t.run (https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.8.5/zone.min.js:1:15134) at https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.8.5/zone.min.js:1:12167 at e.invokeTask (https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.8.5/zone.min.js:1:20606) at t.runTask (https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.8.5/zone.min.js:1:15783) at i (https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.8.5/zone.min.js:1:10706) at XMLHttpRequest.invoke (https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.8.5/zone.min.js:1:21603) Evaluating https://unpkg.com/@angular/platform-browser/bundles/platform-browser.umd.js Error loading https://unpkg.com/@angular/platform-browser/bundles/platform-browser.umd.js as "@angular/platform-browser" from https://run.plnkr.co/M8n19lwO8hX8EWKh/main.ts e.invoke @ zone.min.js:1 run.plnkr.co/M8n19lwO8hX8EWKh/@angular/cdk.ts Failed to load resource: the server responded with a status of 404 ()

LilSebastian5000 avatar Jul 07 '17 16:07 LilSebastian5000

Works for me, be sure to clear your browser cache.

jelbourn avatar Jul 07 '17 16:07 jelbourn

@jelbourn Very odd. I'm seeing the issue on my own Win7 machine and a Win10 VM in chrome. I even have "Disable cache (while DevTools is open)" checked in my Chrome F12 settings. Not sure what's going on, but if it works for you I believe you, guess I'll just wait and see if it fixes itself for me.

LilSebastian5000 avatar Jul 07 '17 16:07 LilSebastian5000

Possibly a propagation delay on the hosting update

jelbourn avatar Jul 07 '17 17:07 jelbourn

Plunkers from https://material.angular.io/components/table/overview don't work. Any of them.

harogaston avatar Sep 05 '17 14:09 harogaston

I have yet to find a working plunkr for md-table's. I found this post when looking for the issue: "Can't bind to 'mdHeaderRowDef' since it isn't a known property of 'md-header-row" in material 2.0.0-beta.8

irco avatar Sep 05 '17 17:09 irco

The fix has been made but not yet pushed out to the docs.

https://github.com/angular/material.angular.io/pull/249

andrewseguin avatar Sep 06 '17 17:09 andrewseguin

@andrewseguin any idea when it will be pushed out?

makdeniss avatar Oct 09 '17 12:10 makdeniss

This is still an issue (version beta.12). I get the following error in the console:

zone.min.js:1 Error: (SystemJS) Unexpected value 'undefined' exported by the module 'PlunkerMaterialModule'
	Error: Unexpected value 'undefined' exported by the module 'PlunkerMaterialModule'
	    at k (https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.8.5/zone.min.js:1:12526)
	    at syntaxError (https://unpkg.com/@angular/compiler/bundles/compiler.umd.js:1729:34)
	    at eval (https://unpkg.com/@angular/compiler/bundles/compiler.umd.js:15447:40)
	    at Array.forEach (<anonymous>)
	    at CompileMetadataResolver.getNgModuleMetadata (https://unpkg.com/@angular/compiler/bundles/compiler.umd.js:15445:49)
	    at CompileMetadataResolver.getNgModuleSummary (https://unpkg.com/@angular/compiler/bundles/compiler.umd.js:15358:52)
	    at eval (https://unpkg.com/@angular/compiler/bundles/compiler.umd.js:15431:72)
	    at Array.forEach (<anonymous>)
	    at CompileMetadataResolver.getNgModuleMetadata (https://unpkg.com/@angular/compiler/bundles/compiler.umd.js:15416:49)
	    at JitCompiler._loadModules (https://unpkg.com/@angular/compiler/bundles/compiler.umd.js:26861:70)
	    at JitCompiler._compileModuleAndComponents (https://unpkg.com/@angular/compiler/bundles/compiler.umd.js:26834:36)
	    at JitCompiler.compileModuleAsync (https://unpkg.com/@angular/compiler/bundles/compiler.umd.js:26763:37)
	    at PlatformRef_._bootstrapModuleWithZone (https://unpkg.com/@angular/core/bundles/core.umd.js:4568:25)
	    at PlatformRef_.bootstrapModule (https://unpkg.com/@angular/core/bundles/core.umd.js:4554:21)
	    at execute (https://run.plnkr.co/3sdHggjfhMW8AlwO/main.ts!transpiled:113:65)
	Error loading https://run.plnkr.co/3sdHggjfhMW8AlwO/main.ts

djfishe avatar Oct 17 '17 15:10 djfishe

The owners should also include cdk/stepper in the includes. I'm finding a lot of plunkers are failing as a result.

'@angular/cdk/stepper' : 'https://unpkg.com/@angular/cdk/bundles/cdk-stepper.umd.js',

inthegarage avatar Nov 02 '17 09:11 inthegarage

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.