TypeError : cannot read properties of (undefined 'method')

I got TypeError: cannot read properties of (undefined ‘method’) at r.init (/a/b/cd/de/assets/vendor-sdfsd234234.js:9594:35

When I looked into the 9594 line on character 35 on the vendor file, here is the line that is causing the issue: line 9593: var e=this.request line 9594: this.request,this.method=e.method,this.body=e.body,this.cookies=e.cookies,this.header=e.headers,this.queryParams … this._host=function() {return e.host()}},host:Ember.compoutd(function(){return this._host()}))})

How can I troubleshoot to find out what js file is exactly responsible for this issue?

Is it possible to reproduce it in development mode?

If not… it looks like it’s coming from your vendor file so the error is occurring in an addon which means it’s probably from node_modules. Maybe ember-data? Try searching your node_modules for this._host? Again though it’s usually a lot easier to reproduce it in a development mode build as you get a much clearer stack trace.

Thanks @dknutsen. It’s coming from node_modules/jsdom/lib/jsdom/living/nodes/ShadowRoot-impl.js when I did a grep on /node_modules. In order to troubleshoot this, should I need to come up with another ShadowRoot version may be?

How can I run development mode? Right now I am running the build from dev server locally only using the build artifact, then pm2 start fastboot-server, then curl localhost:4444 which shows me the error. I have a local ember app but for some reason, that does not show me the same error…may be I could have done something like ember serve --development…?

sorry it is coming from ember-cli-Fastboot/addon/services/fastboot.js.

Ideally you can run it in development mode (just ember serve, no fastboot) and get an error too. I’ve never used fastboot but I’d be concerned that fastboot is masking or swallowing the real error. So if you can reproduce an error doing the same thing without fastboot maybe that can help you find the root cause.

This is the content:

const RequestObject = EObject.extend( init() { this._super(…arguements); let request = this.request; delete this.request; this.method = request.method; etc…