ibm-watson-data-lab / shopping-list-react-pouchdb

Shopping List is an Offline First demo Progressive Web App built using React and PouchDB.
https://ibm-watson-data-lab.github.io/shopping-list-react-pouchdb
Apache License 2.0
27 stars 19 forks source link

React build error #28

Closed glynnbird closed 6 years ago

glynnbird commented 6 years ago

I get a react build error when checking out this repository and running npm run build:

Creating an optimized production build...
Failed to compile.

static/js/main.edbc7407.js from UglifyJs
Name expected [./~/ibm-shopping-list-model/src/ShoppingListFactory.js:5,0][static/js/main.edbc7407.js:16628,6]
isc-rsingh commented 6 years ago

@bradley-holt I seem to remember that this might have something to do with ES6 vs. ES5 incompatibility regarding this app and ibm-shopping-list-model? Does that sound right?

bradley-holt commented 6 years ago

@rajrsingh It appears that this issue has been resolved with 1793a66bbb577fa20521e7cf040e67d3d10a436c and 13504b047f3cb471d65cb601f1ac0751fb70e077. Can you confirm?

isc-rsingh commented 6 years ago

No @bradley-holt that fixes production deployment but breaks development (with npm start). Developer has to toggle between the two methods to do both things. I don't want to take up half the sprint researching a fix. I think we hoped the problem would "go away" with module evolution. I think you couldn't move to ES6 completely was because of cuid module?

isc-rsingh commented 6 years ago

Hey @bradley-holt my gut feeling was that the applitude dependency in cuid was the problem. Looks like it may have been fixed 20 days ago: https://github.com/ericelliott/cuid/issues/41. Want to upgrade cuid module to use v2.0.2 in ibm-shopping-list-model? Maybe my procrastination on this issue has paid off ;)

bradley-holt commented 6 years ago

@rajrsingh I've published v0.3.0 which now uses cuid v2.0.2 if you want to give that a try.

glynnbird commented 6 years ago

I'm still seeing an error with v0.3.0 of the domain model:

$ npm run build

> shopping-list-react-pouchdb@0.1.0 build /Users/glynnb/projects/shopping-list-react-pouchdb
> react-scripts build

Creating an optimized production build...
Failed to compile.

static/js/main.b2f79008.js from UglifyJs
Name expected [./~/ibm-shopping-list-model/src/ShoppingListFactory.js:5,0][static/js/main.b2f79008.js:16925,6]
glynnbird commented 6 years ago

Build works on Node 8.9, not on Node 7.10

vabarbosa commented 6 years ago

@rajrsingh this should be resolved with an updated shopping-list-model-js see: https://github.com/ibm-watson-data-lab/shopping-list-model-js/pull/20

bradley-holt commented 6 years ago

This looks like it's been resolved to me.