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

在使用Babel编译的时候报在函数外部不能return的语法错误 #29

Open
CodeDaraW opened this issue Aug 15, 2017 · 0 comments

Comments

@CodeDaraW
Copy link

报错如下:

Module build failed: SyntaxError: 'return' outside of function (323:1)

  321 | /** ignored by jsdoc **/
  322 | else {
> 323 | 	return Util;
      | 	^
  324 | }

 @ ./~/_xscroll@3.1.3@xscroll/src/xscroll.js 5:11-28
./~/_xscroll@3.1.3@xscroll/src/animate.js
Module build failed: SyntaxError: 'return' outside of function (346:1)

  344 | /** ignored by jsdoc **/
  345 | else {
> 346 | 	return Animate;
      | 	^
  347 | }

 @ ./~/_xscroll@3.1.3@xscroll/src/xscroll.js 8:14-34
./~/_xscroll@3.1.3@xscroll/src/base.js
Module build failed: SyntaxError: 'return' outside of function (66:1)

  64 | /** ignored by jsdoc **/
  65 | else {
> 66 | 	return Base;
     | 	^
  67 | }

 @ ./~/_xscroll@3.1.3@xscroll/src/xscroll.js 6:11-28
./~/_xscroll@3.1.3@xscroll/src/timer.js
Module build failed: SyntaxError: 'return' outside of function (163:1)

  161 | /** ignored by jsdoc **/
  162 | else {
> 163 | 	return Timer;
      | 	^
  164 | }

 @ ./~/_xscroll@3.1.3@xscroll/src/xscroll.js 7:12-30
./~/_xscroll@3.1.3@xscroll/src/hammer.js
Module build failed: SyntaxError: 'return' outside of function (2453:4)

  2451 | /** ignored by jsdoc **/
  2452 | else {
> 2453 |     return Hammer;
       |     ^
  2454 | }

 @ ./~/_xscroll@3.1.3@xscroll/src/xscroll.js 9:13-32
./~/_xscroll@3.1.3@xscroll/src/origin-scroll.js
Module build failed: SyntaxError: 'return' outside of function (134:4)

  132 | /** ignored by jsdoc **/
  133 | else {
> 134 |     return OriginScroll;
      |     ^
  135 | }

 @ ./~/_xscroll@3.1.3@xscroll/src/xscroll.js 11:19-45
./~/_xscroll@3.1.3@xscroll/src/simulate-scroll.js
Module build failed: SyntaxError: 'return' outside of function (696:2)

  694 | /** ignored by jsdoc **/
  695 | else {
> 696 |   return SimuScroll;
      |   ^
  697 | }

是不是可以提供编译后版本呢?
package.json里暴露出编译后的单文件。

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

1 participant