I have a Phoenix umbrella app that uses
react-native-web. It works locally, but in production I get
404s for all assets.
I noticed that if I run
yarn deploy in
/assets, I get
Optimizing of ../priv/static/js/app.js failed. L12175:31 SyntaxError: Unexpected token: operator (>)
(I’m using Brunch’s default config as generated by Phoenix 1.3)
Do you think this is what’s causing the
404, and if so, any idea how to fix it?
(Already checked online and tried submitting an issue with
uglify-js-brunch to no avail…)
UPDATE: Confirmed. This is what’s causing the
404 and will cause the deploy to fail in Heroku.
Given that there aren’t other posts on ElixirForum re: this issue, I would lean towards this having to do with my using
react-native-web and maybe needing some additional config for that??
OK, not going to post an issue there b/c I know the response will be "Not an issue with
react-native-web" and chances are the maintainer won’t know about Brunch… Which means my next move in resolving this is to switch my build tool to Webpack!
(Good thing Phoenix 1.4 will use that by default, precisely for troubleshooting this type of error…)