小编PR7*_*PR7的帖子

Webpack - 类型错误:$ 不是函数

我是 webpack 的新手,我正在使用 webpack 创建一个 React 应用程序。编译时出现此错误TypeError: $ is not a function

在此处输入图片说明

我没有使用 jquery,但我的节点模块包含一些第三方库。

我只能找到一篇与此问题相关的文章,但它与 jquery 相关。 Webpack - $ 不是函数

我的 webpack 和 babel 配置有什么问题吗:

webpack.config.js

const path = require("path");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const FaviconsWebpackPlugin = require("favicons-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const OptimizeCssAssetsPlugin = require("optimize-css-assets-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin;

module.exports = (env) => {
	console.log("WEBPACK ENV: ", env);

	const isDevMode = env !== "production";

	let config …
Run Code Online (Sandbox Code Playgroud)

reactjs webpack babeljs html-webpack-plugin babel-loader

8
推荐指数
1
解决办法
5691
查看次数

gs://<your-cloud-storage-bucket> has no CORS configuration

I am trying to download file from my firebase storage on button click event but it is giving me 'Access-Control-Allow-Origin' error.

https://firebase.google.com/docs/storage/web/download-files

根据上面的链接,我正在尝试配置 CORS。我安装了 gsutil 命令行工具。但我无法找到需要复制此代码的 cors.json 文件

[
 {
 "origin": ["*"],
 "method": ["GET"],
 "maxAgeSeconds": 3600
 }
]
Run Code Online (Sandbox Code Playgroud)

然后我使用gsutil cors get gs://<your-cloud-storage-bucket>返回的命令gsutil cors get gs://<your-cloud-storage-bucket>/ has no CORS configuration

我是否需要先为我的存储桶创建 CORS 配置文件?

下面是我的按钮单击方法,以防错误出现在代码中。

downloadAttachment(fileName) {
var uid = AuthService.uid;
let storageRef = firebase.storage().ref().child('assignments/' + uid + '/' + fileName);
storageRef.getDownloadURL().then(url => {
  console.log(url);
  var xhr = …
Run Code Online (Sandbox Code Playgroud)

cors firebase firebase-storage

3
推荐指数
1
解决办法
4943
查看次数

使用 docker-compose 在派生映像中创建的安装目录时出错

概括

\n

使用docker-compose,使用 Nginx 基础映像中存在的目标目录安装卷可以按预期工作。docker-compose up但是,当挂载目标是在派生映像中创建的子目录时,我收到错误。这是错误的要点:

\n
\n

将“newdir”安装到“/usr/share/nginx/html/newdir”处的rootfs导致:\ nmkdir newdir:只读文件系统:未知

\n
\n

我不明白为什么它似乎在尝试创建已经存在的目录( newdir )!

\n

细节

\n

完整错误如下:

\n
ERROR: for test_nginx_1  Cannot start service nginx: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/home/user/test/newdir" to rootfs at "/usr/share/nginx/html/newdir"  caused: mkdir /var/lib/docker/overlay2/accdaa147d7825a7d2c71b68f76e0b8663d00f6e46fcfb5c0ec32ada8baf85af/merged/usr/share/nginx/html/newdir: read-only file system: unknown\n\nERROR: for nginx  Cannot start service nginx: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting …
Run Code Online (Sandbox Code Playgroud)

docker docker-compose

0
推荐指数
1
解决办法
2901
查看次数