components icon indicating copy to clipboard operation
components copied to clipboard

BrowserAnimationsModule, as described in Getting Started, throws a 404 not found error

Open mLaird opened this issue 9 years ago • 7 comments

Bug, feature request, or proposal:

Bug

What is the expected behavior?

When following instructions in Getting Started, the page should load

What is the current behavior?

If I leave out BrowserAnimationsModule out of app.module.ts, the page loads. When I include BrowserAnimationsModule, per instructions, I get the console error: zone.js:958 GET http://localhost:3000/node_modules/@angular/platform-browser/bundles/platform-browser.umd.js/animations 404 (Not Found)

Upon checking node_modules, there is no such file

What are the steps to reproduce?

Here is the imports section of my code that throws the 404. Remove BrowserAnimationsModule and there is no 404 and the page loads

@NgModule({ imports: [ AgmCoreModule.forRoot( { apiKey: 'blahblahblah', libraries: ['places'] } ), AppRoutingModule, BrowserModule, BrowserAnimationsModule, MdSidenavModule, MdListModule, MdIconModule, MdButtonModule, MdToolbarModule, MdGridListModule, CommonModule, FlexLayoutModule.forRoot(), FormsModule, MaterialModule,

],

My import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; statement is after my import { BrowserModule } from '@angular/platform-browser'; statement

Providing a Plunker (or similar) is the best way to get the team to see your issue. Plunker template: https://goo.gl/DlHd6U

What is the use-case or motivation for changing an existing behavior?

The Getting Started page should lead to working code.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular 4.3.2 Material beta.8 systemjs 0.20.17 Windows 10, latest Creators release Typescript 2.3.4 Chrome and Firefox - both have same behavior regarding BrowserAnimationsModule

Is there anything else we should know?

When I updated to beta.8 from beta.6, some CSS appearance changed. Text in side-nav changed color and spacing in toolbar changed. I don't know if this is my problem or yours. It seems odd that the changes are so selective to just a few CSS features. Whatever, this is a separate issue from the above.

mLaird avatar Aug 01 '17 20:08 mLaird

Are you sure you installed @angular/animations?

npm install --save @angular/animations

Also yeah the CSS changes whenever inconsistencies with the spec are found.

willshowell avatar Aug 01 '17 21:08 willshowell

Yes, I have @angular/animations 4.3.2 The console error suggests to me that some component is incorrectly calling for a file in platform-browser/bundles, but I'm no pro at Angular's internal workings.

On Tue, Aug 1, 2017 at 5:23 PM, Will Howell [email protected] wrote:

Are you sure you installed @angular/animations?

npm install --save @angular/animations

Also yeah the CSS changes whenever inconsistencies with the spec are found.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/angular/material2/issues/6204#issuecomment-319500985, or mute the thread https://github.com/notifications/unsubscribe-auth/ADDSb0cRQuOwFpYgRJXYjXBK9BITMv8Pks5sT5dGgaJpZM4OqSF- .

--

Mike Laird

12 Arbor Creek Drive, Pittsford, New York 14534 [email protected]

". . . remembering on both sides that civility is not a sign of weakness, and sincerity is always subject to proof. Let us never negotiate out of fear, but let us never fear to negotiate." - John F. Kennedy

mLaird avatar Aug 01 '17 21:08 mLaird

Looks like a pathing issue, where its looking for "node_modules/@angular/platform-browser/bundles/platform-browser-animations.umd.js" in the wrong place (with a /animations on the end), hence the 404.

Have you added the correct pathing to seed.config.ts?

Alyaeri avatar Aug 01 '17 23:08 Alyaeri

I have no seed.config.ts Its not part of Material's Getting Started or part of Angular's Getting Started. Note that the Setup Anatomy in Angular docs has no mention of seed.config.ts

https://devdocs.io/angular~2/guide/setup-systemjs-anatomy

Also, beta.8 has no file with /animations on the end. I suspect a call to an incorrect file name.

Lastly, I see that Angular 5.0.0-rc.1 has a bug fix to "export BrowserModule as apart of BrowserAnimationsModule" This is not consistent with MD's Getting Started. I'm not using 5.0.0, but the bug fix says Angular is moving in a different direction than MD's current status.

On Tue, Aug 1, 2017 at 7:04 PM, Rachelle [email protected] wrote:

Looks like a pathing issue, where its looking for "node_modules/@angular/ platform-browser/bundles/platform-browser-animations.umd.js" in the wrong place (with a /animations on the end), hence the 404.

Have you added the correct pathing to seed.config.ts?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/angular/material2/issues/6204#issuecomment-319521357, or mute the thread https://github.com/notifications/unsubscribe-auth/ADDSb8jgN5LiVwBaKIeP3ICxBJc-QHwcks5sT68FgaJpZM4OqSF- .

--

Mike Laird

12 Arbor Creek Drive, Pittsford, New York 14534 [email protected]

". . . remembering on both sides that civility is not a sign of weakness, and sincerity is always subject to proof. Let us never negotiate out of fear, but let us never fear to negotiate." - John F. Kennedy

mLaird avatar Aug 02 '17 00:08 mLaird

While working on a different problem, I discovered that BrowserAnimationsModule in the imports: array of app.module.ts will work and no 404 error appears if (the big if) systemjs.config.js has the following line in the map: object

'@angular/platform-browser/animations': 'npm:@angular/platform-browser/bundles/platform-browser-animations.umd.js',

The Getting Started page should be updated to include that instruction pertaining to BrowserAnimationsModule.

Credit goes to Thomas Burleson whose plnkr for a different problem contained that line. I noticed that it was not in my systemjs.config.ts - because of no Getting Started instructions to add it.

Edit: Ooops, though the above is true, BrowserAnimationsModule caused the input page and the home page to merge into an infinitely scroll-able repeating single page. When I removed BrowserAnimationsModule from the imports: array in app.module.ts, it went back to being 2 pages that route properly between the 2 pages. Something more fundamental needs to be fixed in the code.

mLaird avatar Aug 15 '17 18:08 mLaird

The getting-started guide assumes that the other Angular dependencies (core, common, etc.) are already set up in the System config (if you're using SystemJS).

jelbourn avatar Aug 17 '17 22:08 jelbourn

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.