create-react-app won't build when depending on obj-str
See original GitHub issueThis is a weird one, and I bet this isn’t the right place for it. Running yarn build
in my create-react-app project, it fails with:
$ react-scripts build
Creating an optimized production build...
Failed to compile.
Failed to minify the code from this file:
./node_modules/obj-str/dist/obj-str.es.js:2
Read more here: http://bit.ly/2tRViJ9
error Command failed with exit code 1.
Following the link, it recommends filing an issue, even though I don’t see why this isn’t working.
My dependencies are:
"axios": "^0.16.2",
"date-fns": "^1.28.5",
"immutability-helper": "^2.4.0",
"lodash": "^4.17.4",
"normalize.css": "^7.0.0",
"obj-str": "^1.0.0",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-redux": "^5.0.6",
"react-scripts": "1.0.14",
"redux": "^3.7.2",
"redux-devtools-extension": "^2.13.2",
"redux-thunk": "^2.2.0",
"reselect": "^3.0.1"
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Why won't React production build run on the browser?
When I look at your file structure, I see the everything about build is under the build folder. But in your html file,...
Read more >How To Set Up a React Project with Create React App
Step 1 — Creating a New Project with Create React App. In this step, you'll create a new application using the npm package...
Read more >Don't use create-react-app: How you can set up your own ...
Difficult to add custom build configs. One way to add custom configs is to eject the app, but then it overrides the Only...
Read more >Code-Splitting - React
Deciding where in your app to introduce code splitting can be a bit tricky. You want to make sure you choose places that...
Read more >React Top-Level API
React is the entry point to the React library. If you load React from a <script> tag, these top-level APIs are available on...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey there,
Unfortunately, that’s because of this issue.
This module exposes a
module
entry in thepackage.json
, which webpack will read by default. However, CRA doesn’t respond to this behavior, so theexport default function()...
statement is making it into your build, which then makes Uglify throw, then prints the message you received.Closing since this is a heavily discussed CRA issue, but you could manually delete the
module
field on thenode_module/obj-str/package.json
file and you should be fine. Annoying, but it works.FWIW: CRA should be adding a
include
function that only includes/compilesnode_modules
if they have a"module"
entry. This is what we did inpreact-cli
for a while.Hope that helps!
@mrchief It should now be fixed 👍 I’m not sure how, but I forgot to publish
v1.0.1
after producing fully transformed ES5 code (as seen indist
).Long overdue now, apologies