question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

angular2AppName is not defined

See original GitHub issue

Hi,

I juste move to Jhipster 5.1 and a weird issue.

On a fresh Jhipster install, i install jhipster-prime and get the text below TL;DR angular2AppName is not defined

How can I get rid of this ?

PS : on a fresh jhipster installation i made

npm install -g generator-jhipster-primeng
npm update -g generator-jhipster-primeng 

But when i try yo jhipster-primeng

I got the error.

Any help would be appreciate

Details

C:\Users\giova\Work\Projects\demo-prime-ng>yo jhipster-primeng

β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β•β•β•
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β–ˆβ–ˆβ–ˆβ–ˆβ•”β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ–ˆβ•—
β–ˆβ–ˆβ•”β•β•β•β•  β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β•   β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘
β–ˆβ–ˆβ•‘      β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β•šβ•β• β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•
β•šβ•β•      β•šβ•β•  β•šβ•β• β•šβ•β• β•šβ•β•     β•šβ•β• β•šβ•β•β•β•β•β•β• β•šβ•β•  β•šβ•β•β•β•  β•šβ•β•β•β•β•β•

Welcome to the JHipster primeng generator! v2.0.55

? Do you want to install PrimeNG? Yes
? Which theme would you like to use? Rocket
? What is your preferred component selection criteria Component Groups
? Which component groups you would like to use? inputs, buttons, data, panel, overlay, fileupload, menu, charts, messages, multimedia, dragdrop, misc
Add the resources in the head section of index.html file-  <script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
                                      <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.1.0/fullcalendar.min.css"/>
                                      <script src="https://www.google.com/recaptcha/api.js?render=explicit&onload=initRecaptcha" async defer></script>
                                      <script src="https://cdn.quilljs.com/1.0.0/quill.js"></script>
                                      <script type="text/javascript" src="https://maps.google.com/maps/api/js?key=AIzaSyA6Ar0UymhiklJBzEPLKKn2QHwbjdz3XV0" ></script>
                                      <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment.min.js"></script>
                                      <script src="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.1.0/fullcalendar.min.js"></script>

The PrimeNG resources were updated successfully using JHipster API!
events.js:183
      throw er; // Unhandled 'error' event
      ^

ReferenceError: C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\generators\app\templates\src\main\webapp\app\primeng\primeng.module.ts:4
    2| import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
    3|
 >> 4| import { <%= angular2AppName %>ButtonDemoModule } from './buttons/button/buttondemo.module';
    5| import { <%= angular2AppName %>SplitbuttonDemoModule } from './buttons/splitbutton/splitbuttondemo.module';
    6|
    7| import { <%= angular2AppName %>DialogDemoModule } from './overlay/dialog/dialogdemo.module';

angular2AppName is not defined
    at eval (eval at compile (C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\node_modules\ejs\lib\ejs.js:618:12), <anonymous>:11:26)
    at returnedFn (C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\node_modules\ejs\lib\ejs.js:653:17)
    at Object.exports.render (C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\node_modules\ejs\lib\ejs.js:416:37)
    at process (C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\node_modules\yeoman-generator\node_modules\mem-fs-editor\lib\actions\copy-tpl.js:12:18)
    at applyProcessingFunc (C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\node_modules\yeoman-generator\node_modules\mem-fs-editor\lib\actions\copy.js:13:16)
    at EditionInterface.exports._copySingle (C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\node_modules\yeoman-generator\node_modules\mem-fs-editor\lib\actions\copy.js:63:16)
    at files.forEach.file (C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\node_modules\yeoman-generator\node_modules\mem-fs-editor\lib\actions\copy.js:50:10)
    at Array.forEach (<anonymous>)
    at EditionInterface.exports.copy (C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\node_modules\yeoman-generator\node_modules\mem-fs-editor\lib\actions\copy.js:49:9)
    at EditionInterface.module.exports [as copyTpl] (C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\node_modules\yeoman-generator\node_modules\mem-fs-editor\lib\actions\copy-tpl.js:10:8)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
regeechackocommented, Jul 25, 2018

I am newbie in both angular and jhipster so I am not sure about these steps, but the below steps solved many of my issues

In generator-jhipster-primeng\generators\app\index.js Below line this.angularAppName = this.getAngularAppName(); added this.angular2AppName = this.getAngularXAppName();

In the *.route.ts files under generator-jhipster-primeng\generators\app\templates\src\main\webapp\app\primeng the path to the UserRouteAccessService was wrong. To correct this I searched and replaced the import statements as below

import { UserRouteAccessService } from β€˜β€¦/…/…/shared/shared’; with import { UserRouteAccessService } from β€˜β€¦/…/…/core/auth/user-route-access-service’;

In templates for services the below lines was causing an error .map((response) =>

This was replaced with .map(response =>

1reaction
gkoudjoucommented, Jul 16, 2018

Hi,

I’ve apply the fix you suggest.

In node_modules\generator-jhipster-primeng\generators\app\index.js, i add this line :

this.angular2AppName = this.getAngularAppName()

Installation successfull! But then, i tried to start the application with yarn start and got a LOT of errors.

Please, could you provide any help fixing this ?

Thanks

(this is just an extract of ERRORS and WARNING)

WARNING in ./src/main/webapp/app/primeng/data/schedule/scheduledemo.module.ts [57, 14]: Class name must be in pascal case

@ ./src/main/webapp/app/primeng/primeng.module.ts 58:28-74 @ ./src/main/webapp/app/app.module.ts @ ./src/main/webapp/app/app.main.ts @ multi (webpack)-dev-server/client?http://localhost:9060 webpack/hot/dev-server ./src/main/webapp/app/app.main

WARNING in ./src/main/webapp/app/primeng/data/table/tabledemo.module.ts [57, 14]: Class name must be in pascal case

@ ./src/main/webapp/app/primeng/primeng.module.ts 52:25-65 @ ./src/main/webapp/app/app.module.ts @ ./src/main/webapp/app/app.main.ts @ multi (webpack)-dev-server/client?http://localhost:9060 webpack/hot/dev-server ./src/main/webapp/app/app.main

ERROR in [at-loader] ./src/main/webapp/app/primeng/buttons/button/buttondemo.module.ts:4:10 TS2305: Module β€˜β€œC:/Users/giova/Work/Projects/demo-prime-ng/src/main/webapp/app/shared/index”’ has no exported member β€˜jhipngAppSharedModule’.

ERROR in [at-loader] ./src/main/webapp/app/primeng/buttons/splitbutton/splitbuttondemo.module.ts:5:10 TS2305: Module β€˜β€œC:/Users/giova/Work/Projects/demo-prime-ng/src/main/webapp/app/shared/index”’ has no exported member β€˜jhipngAppSharedModule’.

ERROR in [at-loader] ./src/main/webapp/app/primeng/charts/barchart/barchartdemo.module.ts:4:10 TS2305: Module β€˜β€œC:/Users/giova/Work/Projects/demo-prime-ng/src/main/webapp/app/shared/index”’ has no exported member β€˜jhipngAppSharedModule’.

ERROR in [at-loader] ./src/main/webapp/app/primeng/charts/doughnutchart/doughnutchartdemo.module.ts:4:10 TS2305: Module β€˜β€œC:/Users/giova/Work/Projects/demo-prime-ng/src/main/webapp/app/shared/index”’ has no exported member β€˜jhipngAppSharedModule’.

ERROR in [at-loader] ./src/main/webapp/app/primeng/charts/linechart/linechartdemo.module.ts:4:10 TS2305: Module β€˜β€œC:/Users/giova/Work/Projects/demo-prime-ng/src/main/webapp/app/shared/index”’ has no exported member β€˜jhipngAppSharedModule’.

Read more comments on GitHub >

github_iconTop Results From Across the Web

angular not defined, cannot get angular side of app running
To fix it, try this instead: var app = angular.module('app', ['ngRoute']); app.config(function($routeProvider, $locationProvider){ $locationProvider.
Read more >
How to fix Name Not Defined Error in Python - YouTube
This video will explain how to solve the 'something' is not defined error in Python.
Read more >
NameError: name 'requests' is not defined - YouTube
NameError: name 'requests' is not defined.
Read more >
name 'x' is not defined Python NameError - YouTube
The first video in the series dedicated to debugging various python errors. This video covers the NameError within python.
Read more >
JavaScript lodash lowerFirst Examples
lowerFirst(Type.name)} called with something that's not a subclass of Sequelize. ... options.hooks === undefined ? false : Boolean(options.hooks); options.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found