Code Monkey home page Code Monkey logo

Comments (24)

mraible avatar mraible commented on May 24, 2024

I would recommend that you generate your application in a directory outside your JHipster project. For example:

- backend (JHipster project)
- ionicui (Ionic project)

Then, when you run yo jhipster-ionic:entity course, enter ../backend as the path to your JHipster project.

If that doesn't work, make sure you're using v3.0.2 of this module.

from generator-jhipster-ionic.

canberkizgi avatar canberkizgi commented on May 24, 2024

I just updated generator-jhipster-ionic.
My directories path:
home/can/mucs (my jhipster project)
home/can/mucsapp (generated ionic project.
So paths looks like fine but still i got this error after i run "yo jhipster-ionic:entity course"

Found the .jhipster/Course.json configuration file, entity can be automatically generated!


The entity course is being updated.

Error jhipster-ionic:entity course 

ERROR! 
The entity configuration file could not be read!

from generator-jhipster-ionic.

mraible avatar mraible commented on May 24, 2024

Can you please run yo jhipster-ionic:entity course --debug and paste the stack trace here?.

from generator-jhipster-ionic.

canberkizgi avatar canberkizgi commented on May 24, 2024

Here is the result:


Found the .jhipster/Course.json configuration file, entity can be automatically generated!


The entity course is being updated.

DEBUG! Error:
TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.resolve (path.js:1167:7)
    at Store.get (/home/can/.config/yarn/global/node_modules/mem-fs/index.js:34:21)
    at EditionInterface.module.exports [as exists] (/usr/lib/node_modules/generator-jhipster-ionic/node_modules/mem-fs-editor/lib/actions/exists.js:4:25)
    at EditionInterface.module.exports [as readJSON] (/usr/lib/node_modules/generator-jhipster-ionic/node_modules/mem-fs-editor/lib/actions/read-json.js:4:12)
    at loadEntityJson (/usr/lib/node_modules/generator-jhipster-ionic/node_modules/generator-jhipster/generators/generator-base.js:1735:40)
    at setupconsts (/usr/lib/node_modules/generator-jhipster-ionic/generators/entity/index.js:192:26)
    at Object.<anonymous> (/usr/lib/node_modules/generator-jhipster-ionic/node_modules/yeoman-generator/lib/index.js:399:25)
    at /usr/lib/node_modules/generator-jhipster-ionic/node_modules/yeoman-generator/node_modules/run-async/index.js:25:25
    at /usr/lib/node_modules/generator-jhipster-ionic/node_modules/yeoman-generator/node_modules/run-async/index.js:24:19
Error jhipster-ionic:entity course --debug 

Error: ERROR! 
The entity configuration file could not be read!

    at Environment.error (/home/can/.config/yarn/global/node_modules/yeoman-environment/lib/environment.js:157:40)
    at error (/usr/lib/node_modules/generator-jhipster-ionic/node_modules/generator-jhipster/generators/generator-base.js:1974:18)
    at loadEntityJson (/usr/lib/node_modules/generator-jhipster-ionic/node_modules/generator-jhipster/generators/generator-base.js:1738:18)
    at setupconsts (/usr/lib/node_modules/generator-jhipster-ionic/generators/entity/index.js:192:26)
    at Object.<anonymous> (/usr/lib/node_modules/generator-jhipster-ionic/node_modules/yeoman-generator/lib/index.js:399:25)
    at /usr/lib/node_modules/generator-jhipster-ionic/node_modules/yeoman-generator/node_modules/run-async/index.js:25:25
    at /usr/lib/node_modules/generator-jhipster-ionic/node_modules/yeoman-generator/node_modules/run-async/index.js:24:19
    at self.env.runLoop.add.completed (/usr/lib/node_modules/generator-jhipster-ionic/node_modules/yeoman-generator/lib/index.js:400:11)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)

from generator-jhipster-ionic.

mraible avatar mraible commented on May 24, 2024

Can you include a screenshot to show what you're entering when prompted? Also, if you could include the output from yo jhipster:info in your JHipster project, that'd be great.

from generator-jhipster-ionic.

canberkizgi avatar canberkizgi commented on May 24, 2024

yo jhipster-ionic:entity course --debug
debug

yo jhipster:info
info1
info2
info3

from generator-jhipster-ionic.

mraible avatar mraible commented on May 24, 2024

Can you try deleting the .yo-rc.json file from the parent directory? I believe that's causing this issue because you're not being prompted for the path to the JHipster project.

from generator-jhipster-ionic.

canberkizgi avatar canberkizgi commented on May 24, 2024

Now; my entities are generated.
I regenareted my all entitites. But i got some other errors now.
(I try to regenerate User entity after i got errors but it said:

`
? Do you want to generate this entity from an existing app? Yes
? Enter the path to your app's root directory: (../mucsv2) 
>> .jhipster/User.json not found in ../mucsv2/

`

Here are the screenshoots:
error1
error2

from generator-jhipster-ionic.

mraible avatar mraible commented on May 24, 2024

It looks like you found a scenario in the entity generator that I didn't test yet. Maybe you're using a one-to-one relationship? Can you copy/paste the output from yo jhipster:info in your JHipster project so I can try to reproduce?

Unfortunately, I won't be able to look at this until I'm back from vacation (January 8).

If you'd like to try and fix it in the meantime, see our contributing guide.

from generator-jhipster-ionic.

canberkizgi avatar canberkizgi commented on May 24, 2024

I use one-to-one relationship between Student and User.
I have to present my project next week. Do you have any idea to quickfix?
Also i check your contributing guide.
Here are the yo jhipster:info results
info1
info2
info3

from generator-jhipster-ionic.

mraible avatar mraible commented on May 24, 2024

I would suggest trying to fix it manually in the generated code. Try to figure out what the relationship should look like (by looking at the code in your JHipster/Angular project) and then replicate that code with Ionic. The component classes should look similar.

from generator-jhipster-ionic.

canberkizgi avatar canberkizgi commented on May 24, 2024

I try to fix it.
Also my jhipster project is Angular1.
Can it cause this error?

from generator-jhipster-ionic.

mraible avatar mraible commented on May 24, 2024

Angular 1 shouldn't cause any issues, but you won't be able to look at your project's code for a hint. This module (currently) uses Angular 5 for Ionic.

from generator-jhipster-ionic.

canberkizgi avatar canberkizgi commented on May 24, 2024

I see.
Lastly; here is my announcement-dialog.ts file. It couldn't see user entity.(line 42) I dont understand why. Any idea?
user1
user2

from generator-jhipster-ionic.

mraible avatar mraible commented on May 24, 2024

from generator-jhipster-ionic.

canberkizgi avatar canberkizgi commented on May 24, 2024

It has user property in jhipster.
If i add "public userId?: number," into announcement.model.ts as screenshoot; is it fixed?
add

from generator-jhipster-ionic.

mraible avatar mraible commented on May 24, 2024

Yes, try to reference announcement.userId instead of announcement.user in announcement-dialog.ts.

from generator-jhipster-ionic.

canberkizgi avatar canberkizgi commented on May 24, 2024

I am working on it. Thank you.
have a nice holiday

from generator-jhipster-ionic.

mraible avatar mraible commented on May 24, 2024

Did you get this figured out? If not, can you please run yo jhipster:info in your JHipster backend and copy/paste the output here. I don't want a screenshot, I want text that I can copy and paste to see if I can reproduce/fix the problem.

from generator-jhipster-ionic.

canberkizgi avatar canberkizgi commented on May 24, 2024

Hi i solved it manually.
All output can't be shown here because of some reason.
So i attached it.
output.zip

from generator-jhipster-ionic.

mraible avatar mraible commented on May 24, 2024

from generator-jhipster-ionic.

Bikxs avatar Bikxs commented on May 24, 2024

Encountered this issue while generating entity as below:

bikxs@igor:~/Project/project-skeleton/output/MFSReporting/frontend$` yo jhipster-ionic:entity Report

Just found a `.yo-rc.json` in a parent directory.
Setting the project root at: /home/bikxs/Projects/project-skeleton/output/MFSReporting

Found the .jhipster/Report.json configuration file, entity can be automatically generated!


The entity Report is being updated.

Error jhipster-ionic:entity Report 

ERROR! 
The entity configuration file could not be read!

Got around it by using below work around

  1. rename the ".yi-rc.json" to ".yi-rc.json_old"
  2. On second try yo asks location of jhipster app and continues to generate the entity successfully.
bikxs@igor:~/Projects/project-skeleton/output/MFSReporting/frontend$ yo jhipster-ionic:entity Report

The entity Report is being created.

? Do you want to generate this entity from an existing app? Yes
? Enter the path to your app's root directory: ../

Found the .jhipster/Report.json configuration file, entity can be automatically generated!

? Do you want to update the entity? This will replace the existing files for this entity, all your custom code will be overwritten Yes, re generate the entity
   create src/pages/entities/report/report.html
   create src/pages/entities/report/report.model.ts
   create src/pages/entities/report/report.module.ts
   create src/pages/entities/report/report.provider.ts
   create src/pages/entities/report/report.ts
   create src/pages/entities/report/report-detail.html
   create src/pages/entities/report/report-detail.module.ts
   create src/pages/entities/report/report-detail.ts
   create src/pages/entities/report/report-dialog.html
   create src/pages/entities/report/report-dialog.module.ts
   create src/pages/entities/report/report-dialog.ts
   create src/pages/entities/report/index.ts
 conflict src/pages/entities/entity.ts
? Overwrite src/pages/entities/entity.ts? overwrite this and all others
    force src/pages/entities/entity.ts
Entity generation completed. You may have to stop/start "ionic serve" to see your new entity.
bikxs@igor:~/Projects/project-skeleton/output/MFSReporting/frontend$ 

from generator-jhipster-ionic.

mraible avatar mraible commented on May 24, 2024

This line indicates a configuration issue:

Just found a `.yo-rc.json` in a parent directory.

Make sure you to create your Ionic project in a directory that's at the same level (or above) your JHipster app. Don't create it inside it.

from generator-jhipster-ionic.

mraible avatar mraible commented on May 24, 2024

Closing this as it seems to be a configuration issue.

from generator-jhipster-ionic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.