marmelab/admin-on-rest

Can't create a production build

RPallas92 opened this issue · 1 comments

What you were expecting:
I create a new app using create-react-app as tutorial says.
I run yarn build and production build gets created.

What happened instead:
I run yarn buildand the following error appears:

$ yarn build
yarn run v1.5.1
$ react-scripts build
Creating an optimized production build...
Failed to compile.

Failed to minify the code from this file:

 	./node_modules/admin-on-rest/src/actions/uiActions.js:3

Read more here: http://bit.ly/2tRViJ9

error An unexpected error occurred: "Command failed.
Exit code: 1
Command: sh
Arguments: -c react-scripts build
Directory: /Users/pallaric/Documents/Mobile/projects/training/test-admin
Output:
".
info If you think this is a bug, please open a bug report with the information provided in "/Users/pallaric/Documents/Mobile/projects/training/test-admin/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Steps to reproduce:
Follow the tutorial, and run yarn build.
I am importing import { refreshView as refreshViewAction } from 'admin-on-rest/src/actions/uiActions';

Versions used:

    "admin-on-rest": "^1.4.0",
    "react": "^16.3.0",
    "react-dom": "^16.3.0",
    "react-scripts": "1.1.1"

Fixed by changing import { refreshView as refreshViewAction } from 'admin-on-rest/src/actions/uiActions' to import { refreshView as refreshViewAction } from 'admin-on-rest'

otherwise create-react-app was not transpiling dependencies.