Can not import `bpfrpt_proptype_WindowScroller` when using PhoneInput component

See original GitHub issue

Current Behavior

I am using vite@^2.0.5 (which is using Rollup) and when I import PhoneInput component, it fail to build.

10:03:50 PM [vite] new dependencies found: baseui/phone-input, updating...
 > node_modules/baseui/node_modules/react-virtualized/dist/es/WindowScroller/utils/onScroll.js:74:9: error: No matching export in "node_modules/baseui/node_modules/react-virtualized/dist/es/WindowScroller/WindowScroller.js" for import "bpfrpt_proptype_WindowScroller"
    74 │ import { bpfrpt_proptype_WindowScroller } from "../WindowScroller.js";
       ╵          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expected Behavior

The build stage should be done perfectly.

Your Environment

Tech Version
Base UI v9.111.2
React v17.0.0
Vite v2.0.5
  • I have searched the issues of this repository and believe that this is not a duplicate.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:7

github_iconTop GitHub Comments

3reactions
shunyue1320commented, Sep 1, 2022

vite.config.ts

export default defineConfig({
  plugins: [ reactVirtualized() ], // add
}

const WRONG_CODE = `import { bpfrpt_proptype_WindowScroller } from "../WindowScroller.js";`;
export function reactVirtualized() {
  return {
    name: "my:react-virtualized",
    configResolved() {
      const file = require
        .resolve("react-virtualized")
        .replace(
          path.join("dist", "commonjs", "index.js"),
          path.join("dist", "es", "WindowScroller", "utils", "onScroll.js"),
        );
      const code = fs.readFileSync(file, "utf-8");
      const modified = code.replace(WRONG_CODE, "");
      fs.writeFileSync(file, modified);
    },
  }
}
2reactions
koytacommented, Sep 1, 2022

@shunyue1320 what is WRONG_CODE? 🤔

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-phone-number-input - npm
"Without country select" component is just a phone number <input/> . import PhoneInput from 'react-phone-number-input/input' function ...
Read more >
Cannot override styles with styled component in react-phone ...
Styles can be overridden with additional CSS file imported but not with the styled component. Why? import React from "react"; import styled ...
Read more >
react-phone-input-2 examples - CodeSandbox
Learn how to use react-phone-input-2 by viewing and forking react-phone-input-2 example apps on CodeSandbox.
Read more >
React Phone Number Input - GitHub Pages
import PhoneInput from 'react-phone-number-input' <PhoneInput ... "Without country select" phone number input component can be imported from ...
Read more >
react-phone-input-2 | Yarn - Package Manager
A react component to format phone numbers. react, phone, format, number ... Highly customizable phone input component with auto formatting.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found