Base solution for your next web application
Open Closed

npm run create-bundles error from fresh download v7.0.0 #7114


User avatar
0
nicolaslau created

abpzero:7.0.0 nodejs: yarn: 1.16.0 npm:12.3.1 webpack 4.32.2

....more errors like above


11 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    I did not install webpack globally, the webpack I am using is 4.29.6, which can be used normally without encountering errors.

  • User Avatar
    0
    exlnt created

    I'm having a related issue with the V7.0 upgrade. When I run the cmd "npm run create-bundles" it seems to run but never ends. It just sits here, image below, forever?

    I end up having to CTRL+D to end it forcefully.

  • User Avatar
    0
    maliming created
    Support Team

    @exInt You can remove the --watch option.

    "create-bundles": "webpack --progress --profile --watch --mode=development",

  • User Avatar
    1
    nicolaslau created

    @exlnt It the "watching" feature of webpack that watch files changed and recomplie. check this using-watch-mode. Actually, it finished building and you can force to stop safely. But it stop CI/CD process. You can change the package.json(npm config file at Mvc project dir). like this.

      "scripts": {
        "create-bundles": "webpack --progress --profile --watch --mode=development",
        "build": "webpack --mode=production",
        "create-bundles-no-watch": "webpack --progress --profile --mode=development"
      },
      
    

    change "create-bundles" to remove "--watch" or add a new script like "create-bundles-no-watch" that remove "--watch" and use "npm run create-bundles-no-watch" instead of "npm run create-bundles".

    at webpack production mode, building using "npm run build" will not hang.

  • User Avatar
    0
    exlnt created

    @maliming, @nicolaslau - Thanks for the help! I added the below and it worked perfectly!

    "create-bundles-dev": "webpack --progress --profile --mode=development",
    

    I added all the "custom" bundles for my app into the bundles.json (see below) file (I copied and updated them from my V6.8 solution), however after the "create-bundles" runs I'm not seeing my bundles created? Do I need to do something additional?

      "myAppScripts": [
        {
          "outputFolder": "wwwroot/view-resources/Areas/MyApp/Views/ListValues/_CreateOrEditModal.min.js",
          "input": [
            "wwwroot/view-resources/Areas/MyApp/Views/ListValues/_CreateOrEditModal.js"
          ],
          ///Code removed for brevity
        }
    
  • User Avatar
    0
    ismcagdas created
    Support Team
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @nicolaslau

    I think you have solved the original problem, right ?

  • User Avatar
    0
    exlnt created

    @ismcagdas - Thanks! Question: I had created my own custom "bundles" for a group of scripts I use across many of my pages. How do I get that added/working?

  • User Avatar
    0
    ryancyq created
    Support Team

    @exlnt you can use the output directly in your page or the layout of many pages.

     <script abp-src="/view-resources/Areas/AppAreaName/Views/_Bundles/my-custom-bundle-output.js" asp-append-version="true"></script>
    

    note that min.js is handled (according to environment) via *ScriptSrcTagHelper in ANZ project so that you do not need to handle non-minified and minified files yourself

  • User Avatar
    0
    exlnt created

    I started my own thread sorry for hijacking this thread! :-)

  • User Avatar
    0
    nicolaslau created

    @ismcagdas this problem doesn`t occurs again after a fresh git operation. thanks.