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

按照教程所述步骤在最新版本的create-react-app中去操作失败了 #6

Open
powerlau opened this issue Oct 30, 2018 · 5 comments

Comments

@powerlau
Copy link

我尝试用最近版本create-react-app去操作了一番,结果没成功。
控制台抛出了一个 throw new BrowserslistError('Unknown browser query ' + selection + '')
你可以尝试一下,以前用create-react-app生成的应该可以按照教程做操作没问题,现在不行了。

@powerlau
Copy link
Author

现在成功了,原因是cssnext导致的。然而又发现有个BUG。当npm run start 以后 修改 app.js 中的
import styles from './App.css'; 为 import styles from 'App.css';会提示找不到文件(这个是正常的),然而再改回正确的路径以后,命令行会卡死在 compiling... 最后控制台出现
./src/App.js
Module not found: Can't resolve 'App.css' in 'D:\dev\react-view-layout\src'
Compiling...

<--- Last few GCs --->

[17996:020A6D08] 710237 ms: Scavenge 632.7 (728.8) -> 627.3 (730.8) MB, 15.0 / 0.1 ms (average mu = 0.258, current mu = 0.236) allocation failure
[17996:020A6D08] 711991 ms: Mark-sweep 633.8 (730.8) -> 628.4 (729.3) MB, 1644.6 / 5.5 ms (average mu = 0.244, current mu = 0.230) allocation failure scavenge might not succeed
[17996:020A6D08] 712267 ms: Scavenge 634.9 (729.3) -> 629.5 (731.8) MB, 80.0 / 0.1 ms (average mu = 0.244, current mu = 0.230) allocation failure

<--- JS stacktrace --->

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

0: ExitFrame [pc: 0405209E]
1: StubFrame [pc: 04052ECB]

Security context: 0x04112701
2: resolve [04492DDD] [path.js:~138] [pc=0D9CE9CB](this=0x044a52c5 )
3: arguments adaptor frame: 1->0
4: /* anonymous */ [29DEA711] [D:\dev\react-view-layout\node_modules_watchpack@1.6.0@watchpack\lib\DirectoryWatcher.js:~289] [pc=583D132F](this=0x2a06f7f5 ,err=0x03f04...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 00DD150E
2: 0142AE42
3: 01421BE1
4: 014292DE

@zerocsss
Copy link

throw new BrowserslistError('Unknown browser query ' + selection + '') 请问是怎么解决的

@Amazingzl
Copy link

throw new BrowserslistError('Unknown browser query ' + selection + '') 请问是怎么解决的

在package.json中 修改
"browserslist": [
"last 2 versions",
"android 4",
"opera 12"
],

@bpuns
Copy link

bpuns commented Aug 13, 2019

666666666

@JserJser
Copy link

楼主,你问题解决了咩。我对着作者大大的文档,进行的很顺利,哈哈哈,很喜欢作者大大的这个教程,我也厚脸皮放下我的博客哈:https://www.cnblogs.com/smart-girl/p/11389368.html

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

5 participants