Does not work with core 10.1.0 (possibly nginx only)

Created on 26 June 2023, about 1 year ago
Updated 21 October 2023, 8 months ago

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 🐛 Duplicate X-Content-Type-Options headers both with the value nosniff Fixed

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Closed: cannot reproduce

Version

2.0

Component

Code

Created by

🇦🇺Australia realityloop

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @realityloop
  • Status changed to Closed: cannot reproduce about 1 year ago
  • 🇨🇭Switzerland saschaeggi Zurich

    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

  • Status changed to Active about 1 year ago
  • 🇦🇺Australia realityloop

    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 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.

  • Status changed to Closed: cannot reproduce 12 months ago
  • 🇨🇭Switzerland saschaeggi Zurich

    Closing as I still can't reproduce this.

  • Status changed to Active 11 months ago
  • 🇮🇹Italy FiNeX

    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.

  • 🇨🇭Switzerland saschaeggi Zurich

    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.

  • 🇮🇹Italy FiNeX

    @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).

  • 🇩🇪Germany SteffenR Germany

    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 🐛 Refused to execute script from /files/js/js_yvkkgN0iKZ30AdwlfXvVMCtPnsFwBKc9nQ8FkcPYRzY.js because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. Active

  • Status changed to Closed: cannot reproduce 8 months ago
  • 🇨🇭Switzerland saschaeggi Zurich

    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!

Production build 0.69.0 2024