Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.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
Javascript “预期输入结束”;加上“&引用;子节&引用;“MUL”&引用;分区;,“出人意料”;RPAREN“;_Javascript_Css_Webpack_Gatsby_Postcss - Fatal编程技术网

Javascript “预期输入结束”;加上“&引用;子节&引用;“MUL”&引用;分区;,“出人意料”;RPAREN“;

Javascript “预期输入结束”;加上“&引用;子节&引用;“MUL”&引用;分区;,“出人意料”;RPAREN“;,javascript,css,webpack,gatsby,postcss,Javascript,Css,Webpack,Gatsby,Postcss,在我的盖茨比项目中,每件事都在开发模式下运行良好 使用build命令时,出现以下日志错误: info bootstrap finished - 4.630 s ⠀ failed Building production JavaScript and CSS bundles - 9.761s ERROR #98123 WEBPACK Generating JavaScript bundles failed Parse error on line 1: ...n-x, calc(var(--

在我的盖茨比项目中,每件事都在开发模式下运行良好

使用build命令时,出现以下日志错误:

info bootstrap finished - 4.630 s
⠀
failed Building production JavaScript and CSS bundles - 9.761s

 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

Parse error on line 1:
...n-x, calc(var(--aug-_TlJoinRX, 0px)/2 + var(--aug-_TrJoinLX, 100%)/2)) + var(--...
------------------------------------------------------------------------^
Expecting end of input, "ADD", "SUB", "MUL", "DIV", got unexpected "RPAREN"

not finished run queries - 9.857s
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! project@1.0.0 build: `gatsby build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the project@1.0.0 build script.
经过一些研究,postss似乎无法与增强的UI(在calc函数上)一起工作

我找不到一种方法来禁用此服务器上的POSTSS

我的依赖项版本是:

"gatsby": "^2.18.5",
"gatsby-plugin-postcss": "^2.1.16"
我当前的
postsss.config.js
如下所示:

module.exports = () => ({
  plugins: [require('tailwindcss')],
})

谢谢你在这个问题上的帮助。

我遇到了同样的问题(同样是参数UI),但没有解决它。但这里有一个快速解决方法:

<Helmet>
  <link rel='stylesheet' href='https://unpkg.com/augmented-ui/augmented.css' />
</Helmet>


还有一个提示:我必须删除我的public和.cache文件夹,以使构建包含到CDN的链接。

@Zooly,问题与CSS预处理器缩微器中使用calc函数有关。从增强UI的文档中:

与Create React应用程序的兼容性(在我的情况下,是Vue) 创建React应用程序取决于POSTSS和cssnano。这两个库都存在阻止增强ui的解析错误,因此您需要将augmented-ui.min.css复制到公用文件夹中,并手动将其包含在index.html文件中以避免它们,直到修复为止。

正如您在GitHub上的支持回答中所看到的,您可以将此密钥添加到package.json配置文件中:

"cssnano": {
    "preset": [
      "default",
      {
        "calc": false
      }
    ]
  },
我使用这个变通方法,它可以很好地构建我的Vue项目。希望它也适用于你的