小编Hug*_*Man的帖子

nullish 合并运算符 webpack/bundler 问题

我一直在尝试解决我遇到的这个错误。据我所知,这是空合并运算符(??)的问题。我在网上关注了各种文档,但遇到了同样的问题。关于如何更新我的构建器以避免出现此问题有什么想法吗?

https://babeljs.io/docs/en/babel-plugin-syntax-nullish-coalescing-operator

错误

 Uncaught Error: Module parse failed: Unexpected token (129:61)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|   const transformOuterRef = React.useRef(null);
|   const transformInnerRef = React.useRef(null);
>   const target = (portal == null ? void 0 : portal.current) ?? gl.domElement.parentNode;
|   React.useEffect(() => {
|     if (group.current) {
    at eval (webpack:///./node_modules/@react-three/drei/web/Html.js?:1)
    at Object../node_modules/@react-three/drei/web/Html.js (bundle.js:2069)
    at __webpack_require__ (bundle.js:793)
    at fn (bundle.js:101)
    at eval (webpack:///./node_modules/@react-three/drei/index.js?:2) …
Run Code Online (Sandbox Code Playgroud)

webpack

2
推荐指数
1
解决办法
4565
查看次数

标签 统计

webpack ×1