Skip to content
This repository has been archived by the owner on Sep 24, 2018. It is now read-only.

Can't create a production build #7

Closed
RPallas92 opened this issue Apr 20, 2018 · 1 comment
Closed

Can't create a production build #7

RPallas92 opened this issue Apr 20, 2018 · 1 comment

Comments

@RPallas92
Copy link

RPallas92 commented Apr 20, 2018

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"
@RPallas92
Copy link
Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant