简体   繁体   English

为 React 在 Next.js 中导入 MDB Sass 文件时出错

[英]Error on importing MDB Sass file in Next.js for React

I am trying to use MDBootstrap in my Next.js project.我正在尝试在我的 Next.js 项目中使用 MDBootstrap。 But I want to override MDB color variables, so I just copied scss folder from node-modules/mdbreact and paste it in my public/assets folder.但我想覆盖 MDB 颜色变量,所以我只是从node-modules/mdbreact复制scss文件夹并将其粘贴到我的public/assets文件夹中。 When i import the mdb-free.scss in my index.js , it gives me error:当我在index.js中导入mdb-free.scss时,它给了我错误:

Module not found: Can't resolve '/assets/scss/mdb-free.scss'找不到模块:无法解析“/assets/scss/mdb-free.scss”

I don't know why, here is my project file screenshot:不知道为什么,这是我的项目文件截图: 项目截图 在此处输入图像描述

I have install sass in my project and i got this error while importing my sass file in _app.js我在我的项目中安装了sass ,在 _app.js 中导入我的_app.js文件时出现此错误
在此处输入图像描述

Can you help me with this?你能帮我解决这个问题吗? I wanna override MDB sass color variables to my custom ones.我想将MDB sass颜色变量覆盖为我的自定义颜色变量。 I am stuck我被困住了

I am trying to use MDBootstrap in my Next.js project.我正在尝试在我的 Next.js 项目中使用 MDBootstrap。 But I want to override MDB color variables, so I just copied scss folder from node-modules/mdbreact and paste it in my public/assets folder.但我想覆盖 MDB 颜色变量,所以我只是从node-modules/mdbreact复制scss文件夹并将其粘贴到我的public/assets文件夹中。 When i import the mdb-free.scss in my index.js , it gives me error:当我在index.js中导入mdb-free.scss时,它给了我错误:

Module not found: Can't resolve '/assets/scss/mdb-free.scss'找不到模块:无法解析“/assets/scss/mdb-free.scss”

I don't know why, here is my project file screenshot:不知道为什么,这是我的项目文件截图: 项目截图 在此处输入图像描述

I have install sass in my project and i got this error while importing my sass file in _app.js我在我的项目中安装了sass ,在 _app.js 中导入我的_app.js文件时出现此错误
在此处输入图像描述

Can you help me with this?你能帮我解决这个问题吗? I wanna override MDB sass color variables to my custom ones.我想将MDB sass颜色变量覆盖为我的自定义颜色变量。 I am stuck我被困住了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 带有Sass的Next.js发生错误,提示“您可能需要适当的加载程序来处理此文件类型错误” - Next.js with Sass occurs on error saying “ You may need an appropriate loader to handle this file type error” 在 Next.js 中导入 react-hook-mousetrap 时出现“无法在模块外使用导入语句”错误 - "Cannot use import statement outside a module" error when importing react-hook-mousetrap in Next.js 导入 SVG 作为 React 组件不能与 Next.js 一起使用 - Importing SVG as React component not working with Next.js 如何解决使用 next.js 导入 css 文件时出错? - How do I solve Error importing a css file with next.js? 导入在 Next.JS 项目中分叉和编辑的包时出错 - Error importing a package that was forked and edited in a Next.JS project Next.js Tailwindcss Sass 编译问题 - Next.js Tailwindcss Sass compilation issue 将样式指南添加到 next.js(反应)返回错误:ENOENT:没有这样的文件或目录, - Adding style guide to next.js (react) returns Error: ENOENT: no such file or directory, 文件正在替换文件,而不是在 React (Next.js) 中添加 - File is replacing file, not adding in React (Next.js) Next.js (React) 和 ScrollMagic - Next.js (React) & ScrollMagic 将库导入 Next.js 组件问题 - Importing Library into Next.js Component Issue
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM