Debugging simple deployment (something went wrong)

Hi. First post.

Redwood looks really good. I’ve created a vanilla project that works in development. First thing I have done, before writing any code, is seeing if I can deploy it. I am using yarn rw build and then syncing the contents of web/dist to an s3 website bucket. When the public URL is visited, I get the error Something Went Wrong.

I can run the web component on its own in dev with yarn rw dev web and it works. This leads me to be pretty sure that the API component isn’t being connected to. There’s nothing to indicate any network activity in the developer console either. Based on this I’m ruling out the database.

When I see the Something Went Wrong message, the dev console complains of a Minified React error #130.

What is the correct way to debug this? Any other tips most appreciated.

Update:

This works…

yarn create redwood-app ./redwoodblog
yarn rw dev

Then…

yarn rw build
cd web/dist
python3 -m http.server 80

Launch Chrome http://localhost/ and immediately Something Went Wrong

Would this be expected to work, and if so, how could I debug it?

Welcome @andyi!

Usually when Something went wrong, either it turns into a debug looking page with some trace to the error ( relevant 90% of the time in my case ), or the error should be traced to the network tab of the console, XHR requests, which could provide any error related to the api side.

Can you have a look there and tell us how it goes?

Hi @andyi and welcome!

In addition to “error should be traced to the network tab of the console, XHR requests” which @noire.munich notes and should definitely key us in on the issue …

Could you share the generic error console info that might be in the Chrome Developer Tools for the “something went wrong”?

Thanks and we’ll sort this out, I’m sure.

@noire.munich - no XHR activity at all. Appears not to get that far.

@dthyresson - here’s what the console logs. Error 130 is fairly generic react.

I did note that this error consistently shows up when building with webpack.production.js, regardless of whether running under the dev server or not. Looking into this more now.

react-dom.production.min.js:209 Error: Minified React error #130; visit https://reactjs.org/docs/error-decoder.html?invariant=130&args[]=undefined&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    at _s (react-dom.production.min.js:275)
    at react-dom.production.min.js:148
    at Na (react-dom.production.min.js:173)
    at yu (react-dom.production.min.js:262)
    at cs (react-dom.production.min.js:246)
    at us (react-dom.production.min.js:246)
    at Zu (react-dom.production.min.js:239)
    at Hu (react-dom.production.min.js:230)
    at Ms (react-dom.production.min.js:281)
    at react-dom.production.min.js:284
eu	@	react-dom.production.min.js:209
n.payload	@	react-dom.production.min.js:227
lo	@	react-dom.production.min.js:129
La	@	react-dom.production.min.js:177
yu	@	react-dom.production.min.js:263
cs	@	react-dom.production.min.js:246
us	@	react-dom.production.min.js:246
Zu	@	react-dom.production.min.js:239
Hu	@	react-dom.production.min.js:230
Ms	@	react-dom.production.min.js:281
(anonymous)	@	react-dom.production.min.js:284
ts	@	react-dom.production.min.js:240
Ks	@	react-dom.production.min.js:284
t.render	@	react-dom.production.min.js:290
353	@	index.js:9
i	@	bootstrap:84
t	@	bootstrap:45
r	@	bootstrap:32
(anonymous)	@	app.91c9f063.chunk.js:1

More info. Running these from the project root, immediately after a yarn create redwood-app dev/redwoodblog

Works:

(cd web && ../node_modules/.bin/webpack-dev-server --config ../node_modules/@redwoodjs/core/config/webpack.development.js)

Does not work:

(cd web && ../node_modules/.bin/webpack-dev-server --config ../node_modules/@redwoodjs/core/config/webpack.production.js)

Oh now I see…

webpack.common.js:

isEnvProduction && {
  test: path.join(
    redwoodPaths.base,
    'node_modules/@redwoodjs/router/dist/splash-page'
  ),
  use: 'null-loader',
},

This means if you haven’t added any routes yet and are just trying to deploy the default splash page, you’ll get my error.

Makes perfect sense now, but personally I would have preferred it if it had just deployed exactly what was shown in dev.

1 Like

Good thing you got it sorted!