leo / electron-next

Build Electron apps using Next.js
https://github.com/leo/site/blob/beef3a7dc1dfd435a9d8377e3b1b59761ccb7fc7/pages/2017/electron-next.js
MIT License
548 stars 41 forks source link

Error with uglify & commonjs while building #4

Closed walleXD closed 7 years ago

walleXD commented 7 years ago

I am trying to build the app I have worked on but keep on getting error while building and not exactly sure where the main issue lies. Any idea on what's going wrong here?

{ Error: commons.js from UglifyJs
Unexpected character '`' [commons.js:41299,37]
    at /Volumes/macHome/wahmed/Workspaces/coding/Projects/Phonic/node_modules/next/dist/server/build/index.js:182:21
    at emitRecords.err (/Volumes/macHome/wahmed/Workspaces/coding/Projects/Phonic/node_modules/next/node_modules/webpack/lib/Compiler.js:269:13)
    at Compiler.emitRecords (/Volumes/macHome/wahmed/Workspaces/coding/Projects/Phonic/node_modules/next/node_modules/webpack/lib/Compiler.js:375:38)
    at emitAssets.err (/Volumes/macHome/wahmed/Workspaces/coding/Projects/Phonic/node_modules/next/node_modules/webpack/lib/Compiler.js:262:10)
    at applyPluginsAsyncSeries1.err (/Volumes/macHome/wahmed/Workspaces/coding/Projects/Phonic/node_modules/next/node_modules/webpack/lib/Compiler.js:368:12)
    at next (/Volumes/macHome/wahmed/Workspaces/coding/Projects/Phonic/node_modules/tapable/lib/Tapable.js:218:11)
    at Compiler.compiler.plugin (/Volumes/macHome/wahmed/Workspaces/coding/Projects/Phonic/node_modules/next/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
    at Compiler.applyPluginsAsyncSeries1 (/Volumes/macHome/wahmed/Workspaces/coding/Projects/Phonic/node_modules/tapable/lib/Tapable.js:222:13)
    at Compiler.afterEmit (/Volumes/macHome/wahmed/Workspaces/coding/Projects/Phonic/node_modules/next/node_modules/webpack/lib/Compiler.js:365:9)
    at require.forEach.err (/Volumes/macHome/wahmed/Workspaces/coding/Projects/Phonic/node_modules/next/node_modules/webpack/lib/Compiler.js:360:15)
  errors: [ 'commons.js from UglifyJs\nUnexpected character \'`\' [commons.js:41299,37]' ],
  warnings: [] }
leo commented 7 years ago

This is not related to electron-next. It's either because you have a syntax error in your code or there's some ES2015 code (which Uglify doesn't support yet). 😊