首页 > 解决方案 > “找不到或无法读取要导入的文件:~bootstrap/scss/functions。”,“格式化”:“错误:找不到或无法读取要导入的文件:~

问题描述

我正在尝试运行一个项目,我无法将 css 文件加载到登录网页。我在 npm 构建中发现了这个错误,同时我发现这个问题无法加载图像,尽管它们存在于我的文件夹中.

我对前端很陌生,如果我需要提供任何其他文件配置,请告诉我

在此处输入图像描述

“文件”:“/Users/mthippareddygari/Documents/GitHub/workflow/node_modules/bootstrap-material-design/scss/_variables.scss”,“行”:56,“列”:1,“消息”:“文件到导入未找到或不可读:~bootstrap/scss/functions。","格式化":"错误:要导入的文件未找到或不可读:~bootstrap/scss/functions。\n

网页配置

 module : {
    rules : [
        {
            test: /\.jsx/,
            include: APP_DIR,
            loader: 'babel-loader',
            //Just in case
            exclude: /node_modules/
        },
        //{include: /\.json$/, loaders: ["json-loader"]}
    ]
},

标签: djangoreactjsnpmbootstrap-4

解决方案


你可能需要一些 css(或less/sass)特定的加载器来让 webpack 正确加载你的样式,例如

           {
                test: /\.css$/,
                use: ['style-loader', 'css-loader']
            },

推荐阅读