Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Aurelia template error #469

Closed
Closed

Description

@beatsm

I have just tried to run the Aurelia template and have received the error:

Error: Module 'C:\Local Development\ANetC\node_modules\css\index.js' is not a loader (must have normal or pitch function)

This means that no files are generated in the dist directory.

Any ideas how to resolve?

Activity

  1. nil4 commented on Nov 28, 2016

    @nil4

    @beatsm It's probably related to #444; recent versions of Webpack require the loader name to be spelled-out in full, e.g. css-loader not just css.

  2. SteveSandersonMS commented on Nov 28, 2016

    @SteveSandersonMS
    Member

    Sorry @beatsm. This is due to two breaking changes introduced in dependencies: one in Webpack (as mentioned by @nil4); the other in TypeScript. I'll try to publish an updated Yeoman generator today that fixes both, but in the meantime, you can fix your project like this:

    1. Run yo aspnetcore-spa to create your Aurelia app. Compilation will fail with the not a loader message.
    2. Edit your newly-generated package.json file to lock on to Webpack 2.1.0-beta.25 exactly (rather than allowing newer betas), since that's the only version compatible with Aurelia's webpack loader at the moment. So, edit line 42 so instead of saying "^2.1.0-beta.25", it says "2.1.0-beta.25" (i.e., remove the ^ character).
    3. Back in your command prompt, run npm install again to make your change take effect
    4. Also edit ClientApp/app/components/fetchdata/fetchdata.ts, changing line 16 from this.forecasts = data; to this.forecasts = data as any;.

    Now things will build and run as expected. Run webpack --config webpack.config.vendor.js to rebuild your vendor files, then webpack to rebuild your app files, then dotnet run.

  3. beatsm commented on Nov 28, 2016

    @beatsm
    Author

    @nil4 Thanks v much. Also @SteveSandersonMS keep up the good work, miss your talks at DotNetDevNet......

  4. SteveSandersonMS commented on Nov 28, 2016

    @SteveSandersonMS
    Member

    Updated template 0.6.1 is now published

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions