FountainJS / generator-fountain-angular1

Yeoman 'fountain' generator to start a webapp with Angular 1
http://fountainjs.io
MIT License
95 stars 34 forks source link

Errors in gulp serve:dist / npm run serve:dist mode #86

Open mallik482 opened 7 years ago

mallik482 commented 7 years ago

I have installed latest generator-fountain-angular1 and created a project. Its working in gulp serve/ npm run serve mode but not in gulp serve:dist mode

Error Message & Stack Trace

ERROR in ./~/node-sass/lib/extensions.js
Module not found: Error: Can't resolve 'fs' in '/Users/mallikarjuna/Desktop/fountain/node_modules/node-sass/lib'
 @ ./~/node-sass/lib/extensions.js 6:7-20
 @ ./~/node-sass/lib/index.js
 @ multi vendor

ERROR in ./~/mkdirp/index.js
Module not found: Error: Can't resolve 'fs' in '/Users/mallikarjuna/Desktop/fountain/node_modules/mkdirp'
 @ ./~/mkdirp/index.js 2:9-22
 @ ./~/node-sass/lib/extensions.js
 @ ./~/node-sass/lib/index.js
 @ multi vendor

ERROR in ./~/postcss/lib/previous-map.js
Module not found: Error: Can't resolve 'fs' in '/Users/mallikarjuna/Desktop/fountain/node_modules/postcss/lib'
 @ ./~/postcss/lib/previous-map.js 17:10-23
 @ ./~/postcss/lib/input.js
 @ ./~/postcss/lib/parse.js
 @ ./~/postcss/lib/postcss.js
 @ ./~/postcss-loader/index.js
 @ multi vendor

ERROR in ./~/browserslist/index.js
Module not found: Error: Can't resolve 'fs' in '/Users/mallikarjuna/Desktop/fountain/node_modules/browserslist'
 @ ./~/browserslist/index.js 3:11-24
 @ ./~/postcss-merge-rules/dist/index.js
 @ ./~/cssnano/dist/index.js
 @ ./~/css-loader/lib/processCss.js
 @ ./~/css-loader/lib/loader.js
 @ ./~/css-loader/index.js
 @ multi vendor

ERROR in ./~/svgo/lib/svgo/config.js
Module not found: Error: Can't resolve 'fs' in '/Users/mallikarjuna/Desktop/fountain/node_modules/svgo/lib/svgo'
 @ ./~/svgo/lib/svgo/config.js 3:9-22
 @ ./~/svgo/lib/svgo.js
 @ ./~/postcss-svgo/dist/index.js
 @ ./~/cssnano/dist/index.js
 @ ./~/css-loader/lib/processCss.js
 @ ./~/css-loader/lib/loader.js
 @ ./~/css-loader/index.js
 @ multi vendor

ERROR in ./src/index.scss
Module build failed: ModuleBuildError: Module build failed: Error: Cannot find module '/Users/mallikarjuna/Desktop/fountain/node_modules/css-loader/index.js?minimize'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at loadLoader (/Users/mallikarjuna/Desktop/fountain/node_modules/loader-runner/lib/loadLoader.js:13:17)
    at iteratePitchingLoaders (/Users/mallikarjuna/Desktop/fountain/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at runLoaders (/Users/mallikarjuna/Desktop/fountain/node_modules/loader-runner/lib/LoaderRunner.js:362:2)
    at NormalModule.doBuild (/Users/mallikarjuna/Desktop/fountain/node_modules/webpack/lib/NormalModule.js:131:2)
    at NormalModule.build (/Users/mallikarjuna/Desktop/fountain/node_modules/webpack/lib/NormalModule.js:179:15)
    at Compilation.buildModule (/Users/mallikarjuna/Desktop/fountain/node_modules/webpack/lib/Compilation.js:127:9)
    at Compilation.<anonymous> (/Users/mallikarjuna/Desktop/fountain/node_modules/webpack/lib/Compilation.js:404:8)
    at /Users/mallikarjuna/Desktop/fountain/node_modules/webpack/lib/NormalModuleFactory.js:74:13
    at NormalModuleFactory.applyPluginsAsyncWaterfall (/Users/mallikarjuna/Desktop/fountain/node_modules/tapable/lib/Tapable.js:196:70)
    at onDoneResolving (/Users/mallikarjuna/Desktop/fountain/node_modules/webpack/lib/NormalModuleFactory.js:49:11)
    at onDoneResolving (/Users/mallikarjuna/Desktop/fountain/node_modules/webpack/lib/NormalModuleFactory.js:165:6)
    at /Users/mallikarjuna/Desktop/fountain/node_modules/webpack/lib/NormalModuleFactory.js:161:6
    at /Users/mallikarjuna/Desktop/fountain/node_modules/webpack/lib/NormalModule.js:143:35
    at /Users/mallikarjuna/Desktop/fountain/node_modules/loader-runner/lib/LoaderRunner.js:364:11
    at /Users/mallikarjuna/Desktop/fountain/node_modules/loader-runner/lib/LoaderRunner.js:170:18
    at loadLoader (/Users/mallikarjuna/Desktop/fountain/node_modules/loader-runner/lib/loadLoader.js:27:11)
    at iteratePitchingLoaders (/Users/mallikarjuna/Desktop/fountain/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at runLoaders (/Users/mallikarjuna/Desktop/fountain/node_modules/loader-runner/lib/LoaderRunner.js:362:2)
    at NormalModule.doBuild (/Users/mallikarjuna/Desktop/fountain/node_modules/webpack/lib/NormalModule.js:131:2)
    at NormalModule.build (/Users/mallikarjuna/Desktop/fountain/node_modules/webpack/lib/NormalModule.js:179:15)
    at Compilation.buildModule (/Users/mallikarjuna/Desktop/fountain/node_modules/webpack/lib/Compilation.js:127:9)
    at Compilation.<anonymous> (/Users/mallikarjuna/Desktop/fountain/node_modules/webpack/lib/Compilation.js:404:8)
    at /Users/mallikarjuna/Desktop/fountain/node_modules/webpack/lib/NormalModuleFactory.js:74:13
    at NormalModuleFactory.applyPluginsAsyncWaterfall (/Users/mallikarjuna/Desktop/fountain/node_modules/tapable/lib/Tapable.js:196:70)
    at onDoneResolving (/Users/mallikarjuna/Desktop/fountain/node_modules/webpack/lib/NormalModuleFactory.js:49:11)
    at onDoneResolving (/Users/mallikarjuna/Desktop/fountain/node_modules/webpack/lib/NormalModuleFactory.js:165:6)
    at /Users/mallikarjuna/Desktop/fountain/node_modules/webpack/lib/NormalModuleFactory.js:161:6
    at /Users/mallikarjuna/Desktop/fountain/node_modules/webpack/node_modules/async/dist/async.js:3694:9

ERROR in /Users/mallikarjuna/Desktop/fountain/node_modules/extract-text-webpack-plugin/loader.js?{"omit":1,"remove":true}!/Users/mallikarjuna/Desktop/fountain/node_modules/style-loader/index.js!/Users/mallikarjuna/Desktop/fountain/node_modules/css-loader/index.js?minimize!/Users/mallikarjuna/Desktop/fountain/node_modules/sass-loader/index.js!/Users/mallikarjuna/Desktop/fountain/node_modules/postcss-loader/index.js!/Users/mallikarjuna/Desktop/fountain/src/index.scss doesn't export content
Child html-webpack-plugin for "index.html":
         Asset    Size  Chunks       Chunk Names
    index.html  2.9 kB       0       
Child extract-text-webpack-plugin:

    ERROR in ./~/css-loader?minimize!./~/sass-loader!./~/postcss-loader!./src/index.scss
    Module build failed: Error: Cannot find module '/Users/mallikarjuna/Desktop/fountain/node_modules/css-loader/index.js?minimize'
        at Function.Module._resolveFilename (module.js:469:15)
        at Function.Module._load (module.js:417:25)
        at Module.require (module.js:497:17)
        at require (internal/module.js:20:19)
        at loadLoader (/Users/mallikarjuna/Desktop/fountain/node_modules/loader-runner/lib/loadLoader.js:13:17)
        at iteratePitchingLoaders (/Users/mallikarjuna/Desktop/fountain/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
        at runLoaders (/Users/mallikarjuna/Desktop/fountain/node_modules/loader-runner/lib/LoaderRunner.js:362:2)
        at NormalModule.doBuild (/Users/mallikarjuna/Desktop/fountain/node_modules/webpack/lib/NormalModule.js:131:2)
        at NormalModule.build (/Users/mallikarjuna/Desktop/fountain/node_modules/webpack/lib/NormalModule.js:179:15)
        at Compilation.buildModule (/Users/mallikarjuna/Desktop/fountain/node_modules/webpack/lib/Compilation.js:127:9)
        at Compilation.<anonymous> (/Users/mallikarjuna/Desktop/fountain/node_modules/webpack/lib/Compilation.js:404:8)
        at /Users/mallikarjuna/Desktop/fountain/node_modules/webpack/lib/NormalModuleFactory.js:74:13
        at NormalModuleFactory.applyPluginsAsyncWaterfall (/Users/mallikarjuna/Desktop/fountain/node_modules/tapable/lib/Tapable.js:196:70)
        at onDoneResolving (/Users/mallikarjuna/Desktop/fountain/node_modules/webpack/lib/NormalModuleFactory.js:49:11)
        at onDoneResolving (/Users/mallikarjuna/Desktop/fountain/node_modules/webpack/lib/NormalModuleFactory.js:165:6)
        at /Users/mallikarjuna/Desktop/fountain/node_modules/webpack/lib/NormalModuleFactory.js:161:6

Config

Copy the content from .yo-rc.json:

{
  "generator-fountain-angular1": {
    "version": "1.0.0-rc2",
    "props": {
      "resolved": "/usr/local/lib/node_modules/generator-fountain-angular1/generators/app/index.js",
      "namespace": "fountain-angular1:app",
      "argv": {
        "remain": [],
        "cooked": [],
        "original": []
      },
      "framework": "angular1",
      "modules": "webpack",
      "css": "scss",
      "js": "babel",
      "ci": [
        "jenkins"
      ],
      "sample": "techs",
      "router": "uirouter"
    }
  }
}
Node.js v6.9.2
darwin 16.1.0
yo 1.8.5
npm 3.10.9
dmatta commented 7 years ago

I see the same kind of errors when running npm run build

ERROR in multi vendor
Module not found: Error: Can't resolve 'material-design-iconfont' in '/Users/dmatta/stash/synacor-service-fe-idm-api-test-tool'
 @ multi vendor

ERROR in ./~/mime/mime.js
Module not found: Error: Can't resolve 'fs' in '/Users/dmatta/stash/synacor-service-fe-idm-api-test-tool/node_modules/mime'
 @ ./~/mime/mime.js 2:9-22
 @ ./~/url-loader/index.js
 @ multi vendor

ERROR in ./~/angular-material/angular-material.css
Module build failed: ReferenceError: window is not defined
    at /Users/dmatta/stash/synacor-service-fe-idm-api-test-tool/node_modules/style-loader/index.js!/Users/dmatta/stash/synacor-service-fe-idm-api-test-tool/node_modules/css-loader/index.js?minimize!/Users/dmatta/stash/synacor-service-fe-idm-api-test-tool/node_modules/less-loader/index.js!/Users/dmatta/stash/synacor-service-fe-idm-api-test-tool/node_modules/postcss-loader/index.js!/Users/dmatta/stash/synacor-service-fe-idm-api-test-tool/node_modules/angular-material/angular-material.css:99:30

Any Ideas on how these can be fixed?

bfritscher commented 7 years ago

I had similar issues and solved it using the specific versions mentionned here https://github.com/webpack-contrib/css-loader/issues/240#issuecomment-275378484

"caniuse-db": "1.0.30000615", "extract-text-webpack-plugin": "2.0.0-beta.5"