goldhand / sw-precache-webpack-plugin

Webpack plugin that generates a service worker using sw-precache that will cache webpack's bundles' emitted assets. You can optionally pass sw-precache configuration options to webpack through this plugin.
MIT License
1.44k stars 105 forks source link

webpack build error #123

Closed brave-coder9 closed 6 years ago

brave-coder9 commented 6 years ago

I need help. I am building react.js app. But I met an error.

webpack version: webpack: 3.5.5 webpack-dev-server: 2.7.1

sw-precache-webpack-plugin version: 0.11.4

Please tell us about your environment: OSX 10.12

Current behavior:

node scripts/build.js
Failed to compile.

err =  Error: static/js/1.56d90ea1.chunk.js from UglifyJs
Unexpected token: punc (() [static/js/1.56d90ea1.chunk.js:30331,7]
    at compiler.run (/Volumes/DATA/work/React-Order-SaaS/isomorphic/jason-react/client/scripts/build.js:117:23)
    at emitRecords.err (/Volumes/DATA/work/React-Order-SaaS/isomorphic/jason-react/client/node_modules/webpack/lib/Compiler.js:269:13)
    at Compiler.emitRecords (/Volumes/DATA/work/React-Order-SaaS/isomorphic/jason-react/client/node_modules/webpack/lib/Compiler.js:375:38)
    at emitAssets.err (/Volumes/DATA/work/React-Order-SaaS/isomorphic/jason-react/client/node_modules/webpack/lib/Compiler.js:262:10)
    at applyPluginsAsyncSeries1.err (/Volumes/DATA/work/React-Order-SaaS/isomorphic/jason-react/client/node_modules/webpack/lib/Compiler.js:368:12)
    at next (/Volumes/DATA/work/React-Order-SaaS/isomorphic/jason-react/client/node_modules/tapable/lib/Tapable.js:218:11)
    at Compiler.compiler.plugin (/Volumes/DATA/work/React-Order-SaaS/isomorphic/jason-react/client/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
    at next (/Volumes/DATA/work/React-Order-SaaS/isomorphic/jason-react/client/node_modules/tapable/lib/Tapable.js:220:14)
    at /Volumes/DATA/work/React-Order-SaaS/isomorphic/jason-react/client/node_modules/sw-precache-webpack-plugin/lib/index.js:98:18
    at <anonymous>
goldhand commented 6 years ago

Sorry for the delay, were you able to resolve this issue?

brave-coder9 commented 6 years ago

Thanks for your reply, I have to find out why and where the problem happened. The building doesn't work but dev(npm run dev) works well.

brave-coder9 commented 6 years ago

I found why the build error. When I import 'react-html-email', the building gets the error. Why?

brave-coder9 commented 6 years ago

Fixed: I removed rc* files and kinds of stuff in react-html-email source.