1602 / 1602/compound

Not defined error is encountered when scaffold is camel-cased

Offen
#620 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
1.6k
Forks
179
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I scaffolded using the following command:

`compound g scaffold businessUser propertyOne propertyTwo`

and the following error appeared:

```
businessUser is not defined
at eval (:29:423)
at eval (:31:348)
at /Users/carlo/Documents/code/test-node/node_modules/ejs/lib/ejs.js:255:15
at Object.exports.render (/Users/carlo/Documents/code/test-node/node_modules/ejs/lib/ejs.js:293:13)
at View.exports.renderFile [as engine] (/Users/carlo/Documents/code/test-node/node_modules/ejs/lib/ejs.js:323:20)
at View.render (/Users/carlo/Documents/code/test-node/node_modules/express/lib/view.js:76:8)
at Function.app.render (/Users/carlo/Documents/code/test-node/node_modules/express/lib/application.js:504:10)
at ServerResponse.res.render (/Users/carlo/Documents/code/test-node/node_modules/express/lib/response.js:798:7)
at Controller.renderView (/Users/carlo/Documents/code/test-node/node_modules/compound/lib/controller-extensions.js:156:18)
at Controller.render (/Users/carlo/Documents/code/test-node/node_modules/compound/lib/controller-extensions.js:81:10)
at Object._this (:28:12)
at Array.2 (/Users/carlo/Documents/code/test-node/node_modules/compound/node_modules/kontroller/lib/flow-control.js:157:28)
at ActionContext.run [as innerNext] (/Users/carlo/Documents/code/test-node/node_modules/compound/node_modules/kontroller/lib/flow-control.js:109:31)
at Controller.BaseController.next (/Users/carlo/Documents/code/test-node/node_modules/compound/node_modules/kontroller/lib/base.js:107:22)
at Controller.protectFromForgery (/Users/carlo/Documents/code/test-node/node_modules/compound/node_modules/kontroller/lib/helpers.js:95:14)
at Object.eval (:4:12)
at Array.1 (/Users/carlo/Documents/code/test-node/node_modules/compound/node_modules/kontroller/lib/flow-control.js:157:28)
at run (/Users/carlo/Documents/code/test-node/node_modules/compound/node_modules/kontroller/lib/flow-control.js:109:31)
at Array.0 (/Users/carlo/Documents/code/test-node/node_modules/compound/node_modules/kontroller/lib/flow-control.js:60:13)
at run (/Users/carlo/Documents/code/test-node/node_modules/compound/node_modules/kontroller/lib/flow-control.js:109:31)
at compiledAction.(anonymous function) (/Users/carlo/Documents/code/test-node/node_modules/compound/node_modules/kontroller/lib/flow-control.js:91:13)
at Controller.call (/Users/carlo/Documents/code/test-node/node_modules/compound/node_modules/kontroller/lib/flow-control.js:49:16)
at Controller.call (/Users/carlo/Documents/code/test-node/node_modules/compound/node_modules/kontroller/lib/flow-control.js:94:14)
at Controller.perform (/Users/carlo/Documents/code/test-node/node_modules/compound/node_modules/kontroller/lib/flow-control.js:18:10)
at ControllerBridge.callControllerAction (/Users/carlo/Documents/code/test-node/node_modules/compound/lib/controller-bridge.js:169:9)
at ControllerBridge. (/Users/carlo/Documents/code/test-node/node_modules/compound/lib/controller-bridge.js:149:14)
at callbacks (/Users/carlo/Documents/code/test-node/node_modules/express/lib/router/index.js:164:37)
at param (/Users/carlo/Documents/code/test-node/node_modules/express/lib/router/index.js:138:11)
at param (/Users/carlo/Documents/code/test-node/node_modules/express/lib/router/index.js:135:11)
at pass (/Users/carlo/Documents/code/test-node/node_modules/express/lib/router/index.js:145:5)
at Router._dispatch (/Users/carlo/Documents/code/test-node/node_modules/express/lib/router/index.js:173:5)
at Object.router (/Users/carlo/Documents/code/test-node/node_modules/express/lib/router/index.js:33:10)
at next (/Users/carlo/Documents/code/test-node/node_modules/express/node_modules/connect/lib/proto.js:193:15)
at Object.methodOverride [as handle] (/Users/carlo/Documents/code/test-node/node_modules/express/node_modules/connect/node_modules/method-override/index.js:48:5)
at next (/Users/carlo/Documents/code/test-node/node_modules/express/node_modules/connect/lib/proto.js:193:15)
at /Users/carlo/Documents/code/test-node/node_modules/express/node_modules/connect/node_modules/express-session/index.js:350:9
at Object._onImmediate (/Users/carlo/Documents/code/test-node/node_modules/express/node_modules/connect/node_modules/express-session/session/memory.js:50:9)
at processImmediate [as _immediateCallback] (timers.js:330:15)
```

I suspect the camel-case does not go well with scaffolding.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Look at the scaffold generator code, likely in a generators or scaffolding directory. The error mentions EJS rendering, so check template files that handle model names. The issue is with camel-cased model names like 'businessUser' not being defined in the template context. Start by running the scaffold command locally to reproduce, then trace where the model name variable is passed to the template.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
express, javascript, nodejs
Bereich
backend, cli
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
55/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.