Failed to do transforms - SignalR

I am trying to use signalr and can’t build this simple test project using the built-in bundler. Any help would be appreciated.

I created a new project using the following:

√ Please enter a name for your new project: · signalr4
√ Would you like to use the default setup or customize your choices? · Custom App
√ Which bundler would you like to use? · CLI’s built-in bundler with an AMD module loader
√ Which AMD module loader would you like to use? · RequireJS
√ What platform are you targeting? · Web
√ What transpiler would you like to use? · Babel
√ How would you like to setup your HTML template? · None
√ What css preprocessor would you like to use? · None
√ Do you want to add PostCSS processing · None
√ Which unit test runner would you like to use? · None
√ Would you like to configure integration testing? · None
√ What is your default code editor? · Visual Studio Code
√ Which features do you want scaffolded into your project? · Minimum
√ Would you like to add a Dockerfile? · No

I then added signalR using:

npm i @microsoft/signalr

I modified the app.js to add:

import * as signalR from ‘@microsoft/signalr’

and then ran ‘au build’ and got an error:

Local aurelia-cli v1.3.1
Starting ‘readProjectConfiguration’…
INFO [Bundle] Manually adding package: 2.4.0 aurelia-bootstrapper
INFO [Bundle] Manually adding package: 1.2.1 aurelia-loader-default
INFO [Bundle] Manually adding package: 1.8.1 aurelia-pal-browser
INFO [Bundle] Manually adding package: 1.0.0 aurelia-testing
INFO [Bundle] Manually adding package: 2.0.16 text
Finished ‘readProjectConfiguration’
Starting ‘processMarkup’…
Starting ‘processJson’…
Starting ‘processCSS’…
Starting ‘copyFiles’…
Starting ‘configureEnvironment’…
Finished ‘copyFiles’
Finished ‘processJson’
Finished ‘processCSS’
Finished ‘processMarkup’
Finished ‘configureEnvironment’
Starting ‘buildJavaScript’…
Finished ‘buildJavaScript’
Starting ‘writeBundles’…
INFO [Bundler] Tracing files …
INFO [Bundler] Auto tracing package: 6.0.4 @microsoft/signalr
INFO [Bundler] Auto tracing package: 1.0.3 aurelia-event-aggregator
INFO [Bundler] Auto tracing package: 1.4.1 aurelia-framework
INFO [Bundler] Auto tracing package: 1.4.0 aurelia-history-browser
INFO [Bundler] Auto tracing package: 1.0.2 aurelia-loader
INFO [Bundler] Auto tracing package: 1.1.1 aurelia-logging-console
INFO [Bundler] Auto tracing package: 1.0.7 aurelia-metadata
INFO [Bundler] Auto tracing package: 1.8.2 aurelia-pal
INFO [Bundler] Auto tracing package: 1.3.4 aurelia-polyfills
INFO [Bundler] Auto tracing package: 1.6.0 aurelia-templating-binding
INFO [Bundler] Auto tracing package: 1.14.3 aurelia-templating-resources
INFO [Bundler] Auto tracing package: 1.5.0 aurelia-templating-router
INFO [Bundler] Auto tracing package: 0.13.2 regenerator-runtime
INFO [Bundler] Auto tracing package: 2.5.4 aurelia-binding
INFO [Bundler] Auto tracing package: 1.5.2 aurelia-dependency-injection
INFO [Bundler] Auto tracing package: 1.2.1 aurelia-history
INFO [Bundler] Auto tracing package: 1.5.2 aurelia-logging
INFO [Bundler] Auto tracing package: 1.1.7 aurelia-path
INFO [Bundler] Auto tracing package: 1.7.1 aurelia-router
INFO [Bundler] Auto tracing package: 1.3.3 aurelia-task-queue
INFO [Bundler] Auto tracing package: 1.11.1 aurelia-templating
ERROR [Bundler] Failed to do transforms
INFO [Bundler] Error: Line 29: Unexpected token …
{
uid: 10,
name: ‘writeBundles’,
branch: false,
error: Error: Line 29: Unexpected token …
at ErrorHandler.constructError (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:5012:22)
at ErrorHandler.createError (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:5028:27)
at Parser.unexpectedTokenError (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:1985:39)
at Parser.throwUnexpectedToken (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:1995:21)
at Parser.parseObjectPropertyKey (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:2499:33)
at Parser.parseObjectProperty (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:2534:25)
at Parser.parseObjectInitializer (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:2602:35)
at Parser.inheritCoverGrammar (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:2285:37)
at Parser.parsePrimaryExpression (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:2354:38)
at Parser.inheritCoverGrammar (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:2285:37) {
index: 814,
lineNumber: 29,
description: ‘Unexpected token …’
},
duration: [ 0, 313660300 ],
time: 1650396048995
}
{
uid: 0,
name: ‘’,
branch: true,
error: Error: Line 29: Unexpected token …
at ErrorHandler.constructError (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:5012:22)
at ErrorHandler.createError (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:5028:27)
at Parser.unexpectedTokenError (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:1985:39)
at Parser.throwUnexpectedToken (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:1995:21)
at Parser.parseObjectPropertyKey (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:2499:33)
at Parser.parseObjectProperty (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:2534:25)
at Parser.parseObjectInitializer (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:2602:35)
at Parser.inheritCoverGrammar (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:2285:37)
at Parser.parsePrimaryExpression (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:2354:38)
at Parser.inheritCoverGrammar (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:2285:37) {
index: 814,
lineNumber: 29,
description: ‘Unexpected token …’
},
duration: [ 1, 40438700 ],
time: 1650396049001
}
Error: Line 29: Unexpected token …
at ErrorHandler.constructError (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:5012:22)
at ErrorHandler.createError (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:5028:27)
at Parser.unexpectedTokenError (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:1985:39)
at Parser.throwUnexpectedToken (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:1995:21)
at Parser.parseObjectPropertyKey (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:2499:33)
at Parser.parseObjectProperty (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:2534:25)
at Parser.parseObjectInitializer (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:2602:35)
at Parser.inheritCoverGrammar (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:2285:37)
at Parser.parsePrimaryExpression (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:2354:38)
at Parser.inheritCoverGrammar (D:\Projects\signalr4\node_modules\esprima\dist\esprima.js:2285:37) {
index: 814,
lineNumber: 29,
description: ‘Unexpected token …’
}

You are on a very old version of cli, upgrade to v2.0.3.
The old version uses an outdated esprima js parser which doesn’t understand latest js syntax.

Thanks, that did the trick!