小编ama*_*put的帖子

如何修复 - 找不到模块:无法解析“@babel/runtime/helpers/objectWithoutPropertiesLoose”

我正在做一个 react 项目,在实现这个包https://www.npmjs.com/package/react-bootstrap-typeahead后出现以下错误,然后出现以下错误。

Failed to compile

./node_modules/react-popper/lib/cjs/Popper.js
Module not found: Can't resolve '@babel/runtime/helpers/objectWithoutPropertiesLoose' in 'E:\reactjs\deveans-react-version\node_modules\react-popper\lib\cjs'

This error occurred during the build time and cannot be dismissed.
Run Code Online (Sandbox Code Playgroud)

我找到了很多解决方案,我也尝试过https://github.com/jquense/yup/issues/216但仍然遇到相同的错误。

但是当我删除 Typeahead 组件时,它工作正常。

import React , { Component } from 'react'
import {Typeahead} from 'react-bootstrap-typeahead';
import 'react-bootstrap-typeahead/css/Typeahead.css';
class States extends Component {

    state = {
        multiple: false,
        options: [
          {id: 1, label: 'Pakistan'},
          {id: 2, label: 'Indonesia'},
          {id: 3, label: 'Turkey'},
          {id: 4, label: 'Brazil'},
        ]
      };

    render () …
Run Code Online (Sandbox Code Playgroud)

javascript node-modules reactjs npm-install npm-start

10
推荐指数
4
解决办法
2万
查看次数