gpt4 book ai didi

javascript - 从 node_modules/@blueprintjs 导入样式显示错误 "Error: Failed to find ' ~@blueprintjs/core/lib/css/blueprint'"

转载 作者:行者123 更新时间:2023-11-30 14:32:25 27 4
gpt4 key购买 nike

我尝试从 blueprintjs 库加载样式并遵循 this说明。

在文件 app/javascript/packs/application.js 中我有这段代码:

import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import '../src/index.css';
import { App } from '../src/App';
import store from '../src/stores/store';
...

在文件 app/javascript/src/index.css 中我有这个:

@import '~@blueprintjs/core/lib/css/blueprint';
@import '~@blueprintjs/icons/lib/css/blueprint-icons';

但是当我运行 rails webpacker:compile 时,我收到以下错误消息:

ERROR in ./app/javascript/src/index.css Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js): ModuleBuildError: Module build failed (from ./node_modules/postcss-loader/lib/index.js): Error: Failed to find '~@blueprintjs/core/lib/css/blueprint' in [ /Users/EgorNikitin/todayilearned/app/javascript/src ]

任何帮助都会对我有帮助!

最佳答案

我认为你需要确保你安装了 blueprintjs

yarn add @blueprintjs/core

yarn add react react-dom react-transition-group

同时检查@blueprintjs 文件夹是否位于节点模块文件夹中。如果已经有@blueprintjs 文件夹就好了

关于javascript - 从 node_modules/@blueprintjs 导入样式显示错误 "Error: Failed to find ' ~@blueprintjs/core/lib/css/blueprint'",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50971387/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com