Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

引用国际化中文包报语法错误 #47

Open
Greatwallycc opened this issue Aug 19, 2019 · 1 comment
Open

引用国际化中文包报语法错误 #47

Greatwallycc opened this issue Aug 19, 2019 · 1 comment

Comments

@Greatwallycc
Copy link

写法是这样的:https://codesandbox.io/embed/antd-reproduction-template-pyg3j

报错如下:
(node:99704) UnhandledPromiseRejectionWarning: D:\学习\React\EDS\node_modules\antd\es\locale\zh_CN.js:1
import Pagination from "rc-pagination/es/locale/zh_CN";
^^^^^^^^^^

SyntaxError: Unexpected identifier
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Module._compile (D:\学习\React\EDS\node_modules\pirates\lib\index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Object.newLoader [as .js] (D:\学习\React\EDS\node_modules\pirates\lib\index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (D:\学习\React\EDS\src\ssr/App.js:5:1)
(node:99704) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:99704) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

ctrl+点击可以跳转到文件,路径是没问题的,再说这事antd内部引用的啊,也不是babel的问题,其他的引用编译就没问题。。

@Greatwallycc
Copy link
Author

import React from 'react';
import PropTypes from 'prop-types';
import {Provider} from 'react-redux';
import {ConfigProvider} from 'antd';
import zhCN from 'antd/es/locale/zh_CN';
// import zhCN from 'antd/lib/locale-provider/zh_CN';
import {hot} from 'react-hot-loader/root';
import getStore from './store';

class App extends React.PureComponent {

render () {
return (


{this.props.children ||

There is nothing!

}


)
}
}

export default hot(App);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant