环境
- node v12
- query-string 9.1.0
报错信息
Failed to compile.
./node_modules/query-string/base.js 350:14
Module parse failed: Unexpected token (350:14)
File was processed with these loaders:
* ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| }
| return {
> url: url_?.split('?')?.[0] ?? '',
| query: parse(extract(url), options),
| ...(options && options.parseFragmentIdentifier && hash ? {
解决方式
query-string 从 9.1.0
版本降级到 7.1.3
版本解决。
参考:MDN Web Docs 中 ??
运算符对node版本的支持。