Problem/Motivation

Gin login not updating login form as expected after drupal 10.1.0 update, form is rendered as just text with no theme.

getting errors in console:

The resource from “https://domain/user/login?destination=/sites/default/files/css/css_EwOPq...” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
login
The resource from “https://domain/user/login?destination=/sites/default/files/css/css_XHRnL...” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
login
The resource from “https://domain/user/login?destination=/sites/default/files/js/js_1HL_KtA...” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).

I'm using nginx within ddev as webserver

Possibly related to https://www.drupal.org/project/drupal/issues/2854817

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

realityloop created an issue. See original summary.

realityloop’s picture

Issue summary: View changes
realityloop’s picture

Title: Does not work with core 10.1.0 » Does not work with core 10.1.0 (possibly nginx only)
saschaeggi’s picture

Status: Active » Closed (cannot reproduce)

I don't think this problem is specific to Gin Login (works on 10.1.0 for me).

was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).

You might want to check which stylesheets actually get blocked (try to deactivate aggregation to do so) and if the right MIME type is set (text/css and not text/html).

(If the stylesheets happen to be from Gin Login feel free to reopen this issue).

Cheers

realityloop’s picture

Status: Closed (cannot reproduce) » Active

As posted in Slack:

With aggregation disabled it's working as expected no errors in the console, as soon as I enable aggregation of either CSS or JS, the login page ends up borked. If I login via borked form the rest of the site is displaying as expected.

If I enable JS aggregation the image doesn't load but CSS does, if I enable CSS aggregation the page CSS doesn't load but the image does.

If both are aggregated neither CSS or Images load on login form.

In no case is anything recorded in drupal error log.

saschaeggi’s picture

Status: Active » Closed (cannot reproduce)

Closing as I still can't reproduce this.

finex’s picture

Status: Closed (cannot reproduce) » Active

Hi, I'm experiencing the same problem. I've an Nginx web server and with css aggregation on I have the following error:

Refused to apply style from 'https://...' because its MIME type ('text/plain') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

Probably it could be an error on the nginx settings but I haven't found it yet.

P.S: I'm experiencing the problem on all website pages, not only on the gin login page.

saschaeggi’s picture

P.S: I'm experiencing the problem on all website pages, not only on the gin login page.

Which sounds to me that it’s not a gin_login issue. We don’t set or alter MIME types. It might be related to Drupal 10.1.x new aggregation system with nginx. So you might want to search the core issue queue for a solution.

finex’s picture

@sashaeggi: indeed, I've tought the same. On the next days I'll try to understand better the situation and in case I will open a separate issue (I'll link it here for reference).

steffenr’s picture

Looks like the error was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff). could be caused by a broken / empty src in the script tag. <script type="text/javascript" src="/"></script> tag.

Same error was mentioned here: https://www.drupal.org/project/advagg/issues/3374329

saschaeggi’s picture

Status: Active » Closed (cannot reproduce)

Closing this issue as I'm still unable to reproduce and it was not reported any further.

Also I don't see any reason why we would define any wrong MIME type here.

If I'm wrong feel free to reopen this issue.

Cheers!