Not sure what's happening but this error is preventing the page to display.
The error message is pointing to my bundle.js file (stencil bundle with webpack, babel, etc) and specifically to the Object.assign()
method in the stencil-utils package. It's line 27 of @bigcommerce/stencil-utils/src/lib/request.js
Here's the section of code producing the error.
const defaultOptions = {
method: 'GET',
remote: false,
requestOptions: {
formData: null,
params: {},
config: {},
template: [],
},
};
const options = Object.assign({}, defaultOptions, opts);
const data = options.requestOptions.formData ? options.requestOptions.formData : options.requestOptions.params;
const headers = {
'stencil-config': options.requestOptions.config ? JSON.stringify(options.requestOptions.config) : '{}',
'stencil-options': '{}',
};
Any ideas of what might be causing this?
It happens you're using the
Object.assign
method, which isn't supported by all browsers. Both Internet Explorer and Safari (for Windows) aren't anymore being officially updated.Anyway, there's a polyfill of
Object.assign
in this page. You can apply it in the top of your code.This is my own polyfill, which does optionally avoid creating objects/arrays references (except for objects using any additional interface like
Image
, etc...).