0
votes

Getting an error trying to load aurelia-dragula (and other plugins) from aurelia-cli.

cli

au-install aurelia-dragula

aurelia.json

        {
            "name": "aurelia-dragula",
            "path": "../node_modules/aurelia-dragula/dist/amd",
            "main": "index"
        },
        ...

.js

import { Dragula } from 'aurelia-dragula';

Error :

vendor-bundle.js:23616 ERROR [app-router] Error: Unexpected token <
Evaluating http://localhost:9000/aurelia-dragula

(it's grabbing the index.html in wwwroot folder and failing on parsing the "DocType" tag)

1
What version of the CLI are you running? au -v - Ashley Grant
Hi Ashley, it's 0.30.1 - proggrock

1 Answers

1
votes

First thing I'd recommend you to do is upgrade aurelia-cli to the latest version (currently 0.33.1).

The unexpected token < is a silly error but it simply means that a non-existing file/url was requested from server (aurelia-dragula in your case). Server returns a standard 404 html page which the app then tries to parse as javascript, and that doesn't work.

Your aurelia.json looks fine (tested it locally on a fresh aurelia-cli project) so it's likely to be either a version or caching issue. After upgrading aurelia-cli I'd recommend deleting the lock files and clearing node_modules, followed by a fresh install.