Base solution for your next web application
Open Closed

Module not found error #7383


User avatar
0
triplabor created

Hello,

I am getting this error when I try to start local server

ERROR in ./node_modules/primeng/components/chart/chart.js Module not found: Error: Can't resolve 'chart.js' in '****\angular\node_modules\primeng\components\chart'

However, I don't have chart.js file defined in the angular.json file. Can you help me? Thank you!


9 Answer(s)
  • User Avatar
    1
    maliming created
    Support Team

    Maybe it's about this https://github.com/primefaces/primeng/issues/7769, can you look at it?

  • User Avatar
    0
    triplabor created

    I saw this but the problem is I never used chart.js or anything about chart. I created an entity with Power Tools and then I rebuilt the solution. I switched to Visual Studio Code and ran npm start. I am getting this error weirdly.

  • User Avatar
    0
    maliming created
    Support Team

    Can you share your Angular project source code to: [email protected] ?

  • User Avatar
    0
    triplabor created

    Email sent! Thank you!

  • User Avatar
    0
    rpollak created

    I was having the same issue. I solved it by changing all my primeng imports according to this comment from the github thread maliming shared:

    https://github.com/primefaces/primeng/issues/7769#issuecomment-501220976

  • User Avatar
    0
    triplabor created

    Hey rpollak,

    Oh, that's not good. There are a lot of imports. How could you change them? One by one?

    Thank you!

  • User Avatar
    0
    rpollak created

    Can't say I know a quick way. I just searched my project for 'primeng/primeng' and deleted the lines with those imports. Then I right-clicked all the new red squiggly underlined stuff and carefully selected the appropriate non-'primeng/prime/ng' import paths. Everything compiled for me after making that change.

  • User Avatar
    0
    michael.pear created

    This problem occurs when using the AspNetZero Power Tools....the main-module.ts is updated with statements like:

    import { AutoCompleteModule } from 'primeng/primeng';
    import { PaginatorModule } from 'primeng/primeng';
    import { EditorModule } from 'primeng/primeng';
    import { InputMaskModule } from 'primeng/primeng';import { FileUploadModule } from 'primeng/primeng';
    import { TableModule } from 'primeng/table';
    

    This is goes against earlier advice of being more specific regarding the imports (as is done for TableModule). I don't see these in the file templates section, so they must be introduced programmatically. Should this issue be reported as a Power Tools issue? Or are there other circumstances this is introduced?

  • User Avatar
    0
    maliming created
    Support Team

    hi triplabor I think rpollak and michael.pear point out the problem ,The latest version of zero does not have this problem.

    You can try the above solution.