Webpack 为什么我会得到一个“;“模块解析失败”;在编译我的SASS模块时?
每次运行CRA应用程序时,我都会遇到以下错误,尽管一切都正常运行:Webpack 为什么我会得到一个“;“模块解析失败”;在编译我的SASS模块时?,webpack,create-react-app,dart-sass,Webpack,Create React App,Dart Sass,每次运行CRA应用程序时,我都会遇到以下错误,尽管一切都正常运行: Compiling... Files successfully emitted, waiting for typecheck results... Compiled with warnings. ./src/app/theme/colors.module.scss.d.ts 4:12 Module parse failed: Unexpected token (4:12) File was processed with the
Compiling...
Files successfully emitted, waiting for typecheck results...
Compiled with warnings.
./src/app/theme/colors.module.scss.d.ts 4:12
Module parse failed: Unexpected token (4:12)
File was processed with these loaders:
* ./node_modules/@pmmmwh/react-refresh-webpack-plugin/loader/index.js
* ./node_modules/react-scripts/node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| $RefreshSetup$(module.id);
|
> const colors;
| export default colors;
|
Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.
这是罪犯档案:
export interface AppColors {
background: string;
primary: string;
secondary: string;
}
const colors: AppColors;
export default colors;
它让我可以
怎么了?尝试将文件内容替换为: 声明模块“AppColor”{ 导出接口AppColor{ 背景:字符串; 主:字符串; 第二:字符串; } export=AppColors } 不能在d.ts文件中定义变量
(很抱歉没有格式化代码-从单元格写入)尝试将文件内容替换为: 声明模块“AppColor”{ 导出接口AppColor{ 背景:字符串; 主:字符串; 第二:字符串; } export=AppColors } 不能在d.ts文件中定义变量
(很抱歉没有格式化代码-从单元格写入)最后我不得不替换
const colors:AppColors代码>
与
声明常量颜色:AppColors代码>最后我不得不更换
const colors:AppColors代码>
与
声明常量颜色:AppColors代码>嘿!还想添加你的网页配置,让我们可以看到加载器和他们的订单?嘿!我用的是CRA,不是弹射,嘿!还想添加你的网页配置,让我们可以看到加载器和他们的订单?嘿!我用的是CRA,不是弹射。