Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Webpack 为什么我会得到一个“;“模块解析失败”;在编译我的SASS模块时?_Webpack_Create React App_Dart Sass - Fatal编程技术网

Webpack 为什么我会得到一个“;“模块解析失败”;在编译我的SASS模块时?

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

每次运行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 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,不是弹射。