preact-cli: Build fails when uglifying material component script

Do you want to request a feature or report a bug?

Bug?

What is the current behavior?

yarn start works without error. yarn build and yarn serve fail with this same error.

If the current behavior is a bug, please provide the steps to reproduce.

It doesn’t happen with out of the box configurations, but since it’s dealing with a material design component, it feels like it could be related to the project:

on yarn build:

yarn run v1.3.2
$ preact build
Build [==                  ] 10% (0.1s) building modules(node:46019) DeprecationWarning: Chunk.modules is deprecated. Use Chunk.getNumberOfModules/mapModules/forEachModule/containsModule instead.
✖ ERROR bundle.09240.js from UglifyJs
Unexpected token: name (MDCFoundation) [../node_modules/@material/base/foundation.js:21,6][bundle.09240.js:926,4]
Build failed!
error Command failed with exit code 1.

Please mention other relevant information.

  • node version - 8.4.0
  • yarn version - 1.3.2
  • Operating system - OSX Sierrra.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 19 (11 by maintainers)

Most upvoted comments

I got a similar error:

✖ ERROR route-home.chunk.3d3d6.js from UglifyJs Unexpected token: name (Card) [../node_modules/preact-material-components/Card/index.js:8,6][route-home.chunk.3d3d6.js:38,4] ✖ ERROR route-profile.chunk.75226.js from UglifyJs Unexpected token: name (Profile) [./routes/profile/index.js:6,21][route-profile.chunk.75226.js:37,4] ✖ ERROR bundle.cc43e.js from UglifyJs Unexpected token: operator (>) [../node_modules/preact-material-components/themeUtils/generateThemeClass.js:1,15][bundle.cc43e.js:166,61] Build failed! null

preact watch doesn´t throw any errors, but preact build does

  • node version: 9.7.1
  • yarn version: 1.3.2
  • OS: OSX Sierra

yeah, may be pmc is being used inside this or something. let me just publish the update in a day or two.