You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
When i run my universal react project, the console show me this warning :
This seems to be a pre-built javascript file. Though this is possible, it's not recommended. Try to require the original source to get better results.
[0] @ ./~/react-intl/dist/locale-data/fr.js 1:529-536
In my code :
import * as ReactIntl from 'react-intl';
import frLocale from 'react-intl/dist/locale-data/fr.js';
ReactIntl.addLocaleData(frLocale);
The project is working. I'm using the react-intl V2.
Is this someone has the same problem ?
I'm running into the same warning but my build doesn't go through because of something related to this. It seems to me that the error is fired when Webpack is trying to resolve the dependency from the file's folder, after not finding what it needs in the modules path. Note the extra "/js" at the end of the path.
I am also running on OS X with node 5.1.0, npm 3.3.12 and Webpack 1.12.9.
Is this a Webpack issue?
WARNING in ./~/react-intl/dist/locale-data/en.js
Critical dependencies:
1:529-536 This seems to be a pre-built javascript file. Though this is possible, it's not recommended. Try to require the original source to get better results.
@ ./~/react-intl/dist/locale-data/en.js 1:529-536
ERROR in ./js/frontpage.js
Module not found: Error: Cannot resolve module 'react-intl/locale-data/en' in /Users/path/to/project/js
resolve module react-intl/locale-data/en in /Users/path/to/project/js
looking for modules in /Users/path/to/project/node_modules
resolve 'file' or 'directory' locale-data/en in /Users/path/to/project/node_modules/react-intl
resolve file
/Users/path/to/project/node_modules/react-intl/locale-data/en doesn't exist
/Users/path/to/project/node_modules/react-intl/locale-data/en.webpack.js doesn't exist
/Users/path/to/project/node_modules/react-intl/locale-data/en.web.js doesn't exist
/Users/path/to/project/node_modules/react-intl/locale-data/en.js doesn't exist
/Users/path/to/project/node_modules/react-intl/locale-data/en.json doesn't exist
resolve directory
/Users/path/to/project/node_modules/react-intl/locale-data/en doesn't exist (directory default file)
/Users/path/to/project/node_modules/react-intl/locale-data/en/package.json doesn't exist (directory description file)
[/Users/path/to/project/node_modules/react-intl/locale-data/en]
[/Users/path/to/project/node_modules/react-intl/locale-data/en.webpack.js]
[/Users/path/to/project/node_modules/react-intl/locale-data/en.web.js]
[/Users/path/to/project/node_modules/react-intl/locale-data/en.js]
[/Users/path/to/project/node_modules/react-intl/locale-data/en.json]
@ ./js/frontpage.js 19:10-46
I would recommend importing/requiring: "react-intl/lib/locale-data/fr" or the ES6 module at: "react-intl/src/locale-data/fr". This will likely get rid of the Webpack warning. If it doesn't, please reopen this issue.
Hi, I've hit this as well and the solution for me was what @ericf mentioned. However, I had to import the ones from lib.
If I import the ones from dist then I get the warning like so:
WARNING in ./~/react-intl/dist/locale-data/en.js
Critical dependencies:
1:529-536 This seems to be a pre-built javascript file. Though this is possible, it's not recommended. Try to require the original source to get better results.
@ ./~/react-intl/dist/locale-data/en.js 1:529-536
WARNING in ./~/react-intl/dist/locale-data/ar.js
Critical dependencies:
1:529-536 This seems to be a pre-built javascript file. Though this is possible, it's not recommended. Try to require the original source to get better results.
@ ./~/react-intl/dist/locale-data/ar.js 1:529-536
And if I import the ones from src then I get a parse error like so:
You may need an appropriate loader to handle this file type.
| // GENERATED FILE
....
So yes, importing the ones from lib seems to get rid of the warning. Thanks.
@Eyesonly88 Yeah, I think I'll have to change main in the package.json to be ./lib/index.js for the modules locale data modules to resolve via react-intl/locale-data/en, etc.
Activity
ericf commentedon Dec 17, 2015
What's your build system? What's throwing this warning?
smad commentedon Dec 17, 2015
I'm using node 4.2 on mac O, react 0.14.2 and the warning is on the console
ericf commentedon Dec 17, 2015
You'll have to provide details about the build system that bundling the code.
lapponiandevil commentedon Dec 23, 2015
Hi guys!
I'm running into the same warning but my build doesn't go through because of something related to this. It seems to me that the error is fired when Webpack is trying to resolve the dependency from the file's folder, after not finding what it needs in the modules path. Note the extra "/js" at the end of the path.
https://webpack.github.io/docs/resolving.html
I am also running on OS X with node 5.1.0, npm 3.3.12 and Webpack 1.12.9.
Is this a Webpack issue?
This is a pick from my package.json
ericf commentedon Dec 24, 2015
I would recommend importing/requiring:
"react-intl/lib/locale-data/fr"or the ES6 module at:"react-intl/src/locale-data/fr". This will likely get rid of the Webpack warning. If it doesn't, please reopen this issue.Eyesonly88 commentedon Jan 7, 2016
Hi, I've hit this as well and the solution for me was what @ericf mentioned. However, I had to import the ones from
lib.If I import the ones from
distthen I get the warning like so:And if I import the ones from
srcthen I get a parse error like so:So yes, importing the ones from lib seems to get rid of the warning. Thanks.
ericf commentedon Jan 7, 2016
@Eyesonly88 Yeah, I think I'll have to change
mainin thepackage.jsonto be./lib/index.jsfor the modules locale data modules to resolve viareact-intl/locale-data/en, etc.ericf commentedon Jan 13, 2016
I made some changes to the package layout and
locale-data/modules in #282. I wonder if this fixes these issues.export-mike commentedon Feb 9, 2016
Hi I'm using 2.0.0-beta-2 and getting the same errors reported by: @Eyesonly88
turboza commentedon Feb 12, 2016
@export-mike I am using version 2.0.0-beta-2 with babel 6 and I could make it works now by importing like this.
export-mike commentedon Feb 12, 2016
@turboza 👍 thanks!