question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ReferenceError: LocaleProvider is not defined

See original GitHub issue

初始化项目后,在MAC电脑上可以正常访问,当我在Windows电脑上git clone,npm install, npm start后,报如下错误,备注:在VScode中能找到LocaleProvider的源码。

ReferenceError: LocaleProvider is not defined
RouterConfig
D:/antpro-demo/src/router.js:23
  20 | var routerData = getRouterData(app);
  21 | var UserLayout = routerData['/user'].component;
  22 | var BasicLayout = routerData['/'].component;
> 23 | return React.createElement(LocaleProvider, {
  24 |   locale: zhCN
  25 | }, React.createElement(ConnectedRouter, {
  26 |   history: history
View compiled
▶ 22 stack frames were collapsed.
(anonymous function)
D:/antpro-demo/src/index.js:81
  78 | })(); // 5. Start
  79 | 
  80 | 
> 81 | app.start('#root');
  82 | FastClick.attach(document.body);
  83 | export default app._store; // eslint-disable-line
  84 | 

其中node版本v8.9.4,npm版本5.6.0,具体命令输出如下:

PS D:\antpro-demo> npm install

> husky@0.14.3 install D:\antpro-demo\node_modules\husky
> node ./bin/install.js

husky
setting up Git hooks
done


> react-slick@0.17.1 postinstall D:\antpro-demo\node_modules\react-slick
> opencollective postinstall


     *** Thank you for using react-slick! ***

Please consider donating to our open collective
     to help us maintain this package.

  https://opencollective.com/react-slick/donate

                    ***


> uglifyjs-webpack-plugin@0.4.6 postinstall D:\antpro-demo\node_modules\uglifyjs-webpack-plugin
> node lib/post_install.js


> electron@1.8.2 postinstall D:\antpro-demo\node_modules\electron
> node install.js

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 2170 packages in 70.461s
PS D:\antpro-demo> npm start

> ant-design-pro@1.1.0 start D:\antpro-demo
> cross-env DISABLE_ESLINT=true roadhog dev
Starting the development server...

[babel-plugin-dva-hmr][INFO] got routerPath ./router
Compiled successfully!

You can now view Your App in the browser.

  Local:            http://localhost:8000/
  On Your Network:  http://192.168.2.8:8000/

Note that the development build is not optimized.
To create a production build, use npm run build.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

11reactions
yesmeckcommented, Feb 13, 2018

@everyone Fixed in babel-plugin-import@1.6.4, try reinstall node_modules.

0reactions
FanShiDecommented, Feb 13, 2018

the same problem i have met. node version: 8.9.4, Ubuntu 16.04

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ant Design breaks on Meteor 1.4.4 - help
When I go to localhost:3000 I get: Uncaught ReferenceError: LocaleProvider is not defined at app.js:281 at maybeReady (meteor.js:809) at ...
Read more >
Antd locale is undefined - Stack Overflow
It may be related to webpack and typescript? Here is the workaround for it: // Original code in doc which will not work...
Read more >
Change Log - Ant Design
LocaleProvider has been deprecated in 4.x (use <ConfigProvider locale /> instead), we removed the related folder antd/es/locale-provider and ...
Read more >
Line 12:6: 'Fragment' is not defined react/jsx-no-undef Code ...
'App' is not defined react/jsx-no-undef import App from "./App"; //import into index.js file.
Read more >
How to fix "Uncaught ReferenceError: x is not defined" in ...
JS Casts 04 - How to fix "Uncaught TypeError: x is not a function " in JavaScript.Visit https://javascriptcasts.com/episodes/04 for a summary ...
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