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:
- Created 6 years ago
- Comments:15 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@everyone Fixed in
babel-plugin-import@1.6.4
, try reinstall node_modules.the same problem i have met. node version:
8.9.4
, Ubuntu 16.04