As of last week 1/10 I started getting an error in...
# suitecommerce
b
As of last week 1/10 I started getting an error in the console for requesting the customFieldsMetadata file that says:
Copy code
Refused to execute script from '<https://www.domain.com/secure/customFieldsMetadata.ssp?t=1679932890576>' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled.
This is causing the cart component to be unable to
setTransactionBodyField
for a custom field. Has anyone else started getting this error?
s
That is a super weird error to get. That should never be set to text/plain. You're not using a proxy or third-party CDN are you?
e
I have been getting that error as well on different accounts.
s
bwah
I got nothing – please raise a case if it keeps happening (and you think you can replicate it!)
b
No proxy or third-party CDN. I created a case so we'll see
s
Can you check your response headers on the network call for it and tell me if X-Content-Type-Options has been set, and its value is nosniff ?
b
Yes, it has that value "nosniff"
s
OK
So, what I think is happening is that the server has started setting that header (I am not aware of us making this change, so I would need to look into it) and in that one file, we have not explicitly set the MIME type in the response to be JavaScript. As we have told the browser not to try and detect its type, and we have not set a type, it's forced to assume it's plain text, which it obviously isn't.
But that is my theory.
Although, weirdly, when I look at the source, I can see this:
response.setContentType('JAVASCRIPT');
So now I'm confused :X
Let's see what support says 😄
b
When you say source are you talking about in the customFieldsMetadata.ssp file?
ah ok yeah i see that too, but we're on 2023.1 and its not present in that file
only in the 2024.1 version
I added it to the version we're on and it's working now no more error. Thanks @Steve Goldberg!
netsuite halo 1
s
Aha!