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

react-intl-universal build failed with create-react-app #16

Closed
lany9527 opened this issue Jul 17, 2017 · 8 comments
Closed

react-intl-universal build failed with create-react-app #16

lany9527 opened this issue Jul 17, 2017 · 8 comments

Comments

@lany9527
Copy link

我按照例子配置了我的项目,发现build很久,大概5min以上,到最后失败了:报错如下:
`
yarn build
yarn build v0.27.5
$ node scripts/build.js
Creating an optimized production build...

<--- Last few GCs --->

[15101:0x2ae6680] 333362 ms: Mark-sweep 1401.1 (1522.6) -> 1401.1 (1521.6) MB, 884.7 / 0.0 ms (+ 0.0 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 885 ms) last resort
[15101:0x2ae6680] 334267 ms: Mark-sweep 1401.1 (1521.6) -> 1401.1 (1521.6) MB, 904.4 / 0.0 ms last resort

<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x175f3e2266a1
2: _serializeMappings(aka SourceMapGenerator_serializeMappings) [/home/littlestone/Documents/work/duomi-cp/node_modules/source-map/lib/source-map-generator.js:~291] [pc=0x2db6aa584db4](this=0x1fa145e2b651 <a SourceMapGenerator with map 0x28d6ae1d0491>)
3: toJSON(aka SourceMapGenerator_toJSON) [/home/littlestone/Documents/work/duomi-cp/node_modules/source-map/lib/source-map-generator.js:...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: node::Abort() [node]
2: 0x12b82ac [node]
3: v8::Utils::ReportOOMFailure(char const*, bool) [node]
4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [node]
5: v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [node]
6: v8::internal::Runtime_AllocateInTargetSpace(int, v8::internal::Object**, v8::internal::Isolate*) [node]
7: 0x2db6a748ed46
Aborted
error Command failed with exit code 134.

`
我降了版本还是无法解决问题。请问有没有人能解决这个问题?

@cwtuan
Copy link
Collaborator

cwtuan commented Jul 17, 2017

could you show more detail about your build config?

@lany9527
Copy link
Author

@cwtuan 你好,我用的是create-react-app生成的项目,然后按照例子配置的,没有什么build config。你能说的详细点吗,或者是我哪里理解错了

@cwtuan
Copy link
Collaborator

cwtuan commented Jul 17, 2017

what's your node version and create-react-app version?

@lany9527
Copy link
Author

@cwtuan

version:

node -v:

v7.10.0

create-react-app --version :

1.3.3

thank you

@cwtuan
Copy link
Collaborator

cwtuan commented Jul 17, 2017

@lany9527
I got the same error when using create-react-app, but react-intl-universal works fine with webpack in my project. I will fix this create-react-app issue in next release.

Currently, could you please use webpack as building tool? create-react-app is suitable for demo project. For production product, webpack is strongly recommended.

There are lots of react+webpack generators on the web, you can try generator-react-webpack to generate a new project quickly.

@lany9527
Copy link
Author

lany9527 commented Jul 17, 2017

@cwtuan 谢谢你的耐心解答,我用create-react-app的时候eject了,然后在config的webpack部分里面配置了多入口
###【我参考了这里:http://imshuai.com/create-react-app-multiple-entry-points/ 】,
但是我降低为v1.1.1版本之后,再删掉多入口的配置部分,就能够build了,因为项目比较紧,所以,还没时间深究到底发生了什么,才导致build错误。如果你知道了,请告诉我哦,谢谢啦。

@cwtuan cwtuan changed the title react-intl-universal build失败 react-intl-universal build failed with create-react-app Jul 28, 2017
@hwwn
Copy link

hwwn commented Aug 4, 2017

我这边的项目也是 用 create-reat-app做的, 同样是build的时候先卡住,之后报了一样的错误提示

@cwtuan
Copy link
Collaborator

cwtuan commented Aug 15, 2017

@lany9527 @hwwn
Please upgrade to v1.3.4 to fix build issue.

@cwtuan cwtuan closed this as completed Aug 15, 2017
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

3 participants