ant-design-mobile: antd-mobile does not contain an export

Version

1.1.3

Environment

react (web browsers)

Reproduction link

https://codesandbox.io/s/013KDJPN

Steps to reproduce

  1. I’ve run npm install antd-mobile --save on a new project
  2. I’ve imported the following code:
import React, { Component } from 'react';
import { Button } from 'antd-mobile';

class HomePage extends Component {
  render() {
    return (
          <Button type="primary">test</Button>
    );
  }
}

export default HomePage;

What is expected?

That I see the antd-mobile elements

What is actually happening?

It cannot import elements from ‘antd-mobile’

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 24 (12 by maintainers)

Most upvoted comments

Same issue occurred when I executed “yarn build”

$ node scripts/build.js
Creating an optimized production build...
Failed to compile.

./src/mobile/callback.js
80:28-38 'antd-mobile' does not contain an export named 'WhiteSpace'.

error Command failed with exit code 1.

Great- thanks so much for the hard work on this. I’m updating a detailed readme which will help other users using the new CRA with Webpack 2.

It works- but everything very large/scaled (such as fonts and elements). They do not look like the demo page. Any ideas?

EDIT: I have read the doc, but I may have missed something here so apologies,