Skip to content

couldn't find file ... with type 'application/javascript' when using *.js.jst.ejs.slim #497

Closed
@stiller-leser

Description

@stiller-leser

Expected behavior

It should find and load the file (works fine in Sprockets 3)

Actual behavior

Instead it throws Sprockets::FileNotFound: couldn't find file... with type 'application/javascript'

System configuration

  • Sprockets version: 4.0.0.beta5
  • Ruby version: 2.3.0

Additional Information

If I do a Rails.application.assets.find_asset!('*.js.jst.ejs.slim') it returns:

#<Sprockets::Asset:3fe5365d1f28 "file:///path/to/file/file_name.js.jst.ejs.slim?type=text/slim&id=ecf6b827b96529b096b11377d14aa880b60a9fca5a49b0ea04d42b4b4933011d">

If I curl the file I can still see slim-syntax in there, so either the slim gem does not pick the files up, or if the syntax is supposed to be in there, the 'application/javascript' returned by sprockets is wrong.

How sprockets 3 behaves

If I curl the files using sprockets 3.7.1 the slim syntax is still present, but the file is correctly identified as 'application/javascript' and not 'text/slim'. Hence, this issue is related to #475 and could be fixed by adding to PR #491 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions