Module not found when performing webpack

Posted by: kevin.krohn on 1 March 2018, 9:21 am EST

  • Posted 1 March 2018, 9:21 am EST

    I have an angular2 app and have included included wijmo in the package.json file as instructed. npm install copies the files to the node_modules folder but the wijmo folder is just a link to the other folder location. With this, webpack fails with module not found errors like the following:

    ERROR in …/NpmImages/wijmo-commonjs-min/wijmo.angular2.grid.js

    Module not found: Error: Can’t resolve ‘@angular/forms’ in ‘C:\EngineeringSpecialists\NpmImages\wijmo-commonjs-min’

    @ …/NpmImages/wijmo-commonjs-min/wijmo.angular2.grid.js 13:778-803

    @ ./ClientApp/app/app.module.ts

    @ ./ClientApp/app/app.module.browser.ts

    @ ./ClientApp/boot.browser.ts

    Am I missing a step?

  • Posted 2 March 2018, 1:30 am EST

    Seems as though if I create a wijmo folder under node_modules, copy the files into the folder and run webpack, everything works fine. If I do a npm install first and then run webpack, the folder structure changes and I get the reference errors.

  • Posted 4 March 2018, 10:05 pm EST

    Hi,

    This is an expected behavior . NPM modules for

    Wijmo are required to be copied inside the node_modules for them to run. Is this creating any issues for you?

  • Posted 5 March 2018, 4:06 am EST

    I understand that but when I let npm install copy the files to the wijmo folder, I receive the module not found error. If I copy the files manually to the wijmo folder, everything works fine. I do a publish through Visual Studio and that does an npm install as part of the publishing. When that happens, it removes the folder and then copies the files back to the wijmo folder but it seems as though it just does a link the the original source folder because the folder icon has a curved arrow with it. Therefore, when it compiles, it can’t find any reference. I am currently doing a two step process to get around this. I compile the server dll for the api through VS and then I run a production build command to packup all the javascript files.

  • Posted 5 March 2018, 9:10 pm EST

    Kevin,

    I understand the issue at hand. I will notify the dev team about this and if we can do something regarding this. However, It will take us some time to address this.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels