Skip to content

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

@Greatwallycc

Description

@Greatwallycc

写法是这样的: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的问题,其他的引用编译就没问题。。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions