kriasoft / kriasoft/aspnet-starter-kit

PostCSS @import

Open
#33 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.2k
Forks
198
PR merge metrics
No merged PRs in 30d

Description

Hi,

I'm trying to use @import in the css but I get an error 'Module not found. Example:

Layout.js
import s from './Layout.css';

Layout.css
@import "base/_variables";

When I replace the css import with "/base/_variables"; I no longer get the error but on page load the following shows up in the debug console:

Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:3000/base/_variables".

I'm assuming it's an issue with the webpack config?

Any assistance would be greatly appreciated.

Thanks in advance!

Contributor guide

Open the contributing guide

Research direction

Start with Layout.js and Layout.css, then inspect the webpack configuration related to the referenced base/_variables import. Reproduce the module-not-found error and check the browser's MIME-type warning; the issue is done when the CSS import builds successfully and the referenced stylesheet is served as CSS.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.