Skip to content

Trailing comma for a path in router.js causes ember g route failure #134

Description

@saivarunr

image

Notice the comma at the end of path option.

When I try to generate route
image

I get this error.

`
ENV Summary:

TIME: Thu Feb 27 2020 10:25:48 GMT+0000 (Coordinated Universal Time)
TITLE: ember
ARGV:

/usr/local/bin/node
/usr/local/bin/ember
g
route
workspace
EXEC_PATH: /usr/local/bin/node
TMPDIR: /tmp
SHELL: /bin/bash
PATH:
/usr/local/sbin
/usr/local/bin
/usr/sbin
/usr/bin
/sbin
/bin
PLATFORM: linux x64
FREEMEM: 17924247552
TOTALMEM: 33601220608
UPTIME: 2705
LOADAVG: 3.38330078125,2.31201171875,2.2646484375
CPUS:
Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz - 2970
Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz - 2995
Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz - 3029
Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz - 3029
Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz - 2980
Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz - 2976
Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz - 3005
Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz - 3013
ENDIANNESS: LE
VERSIONS:
ares: 1.15.0
brotli: 1.0.7
cldr: 35.1
http_parser: 2.9.3
icu: 64.2
modules: 64
napi: 5
nghttp2: 1.39.2
node: 10.19.0
openssl: 1.1.1d
tz: 2019c
unicode: 12.1
uv: 1.28.0
v8: 6.8.275.32-node.55
zlib: 1.2.11
ERROR Summary:

broccoliBuilderErrorStack: [undefined]
code: [undefined]
codeFrame: [undefined]
errorMessage: Line 182: Unexpected token )
errorType: [undefined]
location:
column: [undefined]
file: [undefined]
line: [undefined]
message: Line 182: Unexpected token )
name: Error
nodeAnnotation: [undefined]
nodeName: [undefined]
originalErrorMessage: [undefined]
stack: Error: Line 182: Unexpected token )
at ErrorHandler.constructError (/root/xvector/x-ui/node_modules/ember-router-generator/node_modules/esprima/dist/esprima.js:3396:22)
at ErrorHandler.createError (/root/xvector/x-ui/node_modules/ember-router-generator/node_modules/esprima/dist/esprima.js:3414:27)
at JSXParser.Parser.unexpectedTokenError (/root/xvector/x-ui/node_modules/ember-router-generator/node_modules/esprima/dist/esprima.js:542:39)
at JSXParser.Parser.throwUnexpectedToken (/root/xvector/x-ui/node_modules/ember-router-generator/node_modules/esprima/dist/esprima.js:552:21)
at JSXParser.Parser.parsePrimaryExpression (/root/xvector/x-ui/node_modules/ember-router-generator/node_modules/esprima/dist/esprima.js:917:31)
at JSXParser.parsePrimaryExpression (/root/xvector/x-ui/node_modules/ember-router-generator/node_modules/esprima/dist/esprima.js:5365:97)
at JSXParser.Parser.inheritCoverGrammar (/root/xvector/x-ui/node_modules/ember-router-generator/node_modules/esprima/dist/esprima.js:833:37)
at JSXParser.Parser.parseLeftHandSideExpressionAllowCall (/root/xvector/x-ui/node_modules/ember-router-generator/node_modules/esprima/dist/esprima.js:1388:26)
at JSXParser.Parser.inheritCoverGrammar (/root/xvector/x-ui/node_modules/ember-router-generator/node_modules/esprima/dist/esprima.js:833:37)
at JSXParser.Parser.parseUpdateExpression (/root/xvector/x-ui/node_modules/ember-router-generator/node_modules/esprima/dist/esprima.js:1482:26)
`
Remove the comma the error goes away.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions