Ncc: Got is failing to compile

Created on 23 Nov 2018  路  5Comments  路  Source: vercel/ncc

Original thread: https://spectrum.chat/zeit/now/now-is-failing-because-of-missing-npm-dependencies~d3155f18-59a9-48b0-900a-69038d337e08

Referenced GH issue: https://github.com/sindresorhus/got/issues/345#issuecomment-315397111

More information:

ERROR in /tmp/3694173/user/node_modules/path-platform/path.js 32:2
Module parse failed: 'return' outside of function (32:2)
You may need an appropriate loader to handle this file type.
| if (_path.posix) {
|   module.exports = _path;
>   return;
| }
|
 @ /tmp/3694173/user/node_modules/parents/index.js 1:19-43
 @ /tmp/3694173/user/node_modules/module-deps/index.js
 @ /tmp/3694173/user/node_modules/browserify/index.js
 @ /tmp/3694173/user/node_modules/lyo/lib/task.js
 @ /tmp/3694173/user/node_modules/lyo/index.js
 @ /tmp/3694173/user/lib/compile.js
 @ /tmp/3694173/user/handlers/compile.js
    at compiler.run (/tmp/3694173/ncc/node_modules/@zeit/ncc/index.js:65:23)
    at finalCallback (/tmp/3694173/ncc/node_modules/@zeit/ncc/webpack/lib/Compiler.js:210:39)
    at hooks.done.callAsync.err (/tmp/3694173/ncc/node_modules/@zeit/ncc/webpack/lib/Compiler.js:226:13)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/tmp/3694173/ncc/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (/tmp/3694173/ncc/node_modules/tapable/lib/Hook.js:154:20)
    at onCompiled (/tmp/3694173/ncc/node_modules/@zeit/ncc/webpack/lib/Compiler.js:224:21)
    at hooks.afterCompile.callAsync.err (/tmp/3694173/ncc/node_modules/@zeit/ncc/webpack/lib/Compiler.js:552:14)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/tmp/3694173/ncc/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (/tmp/3694173/ncc/node_modules/tapable/lib/Hook.js:154:20)
    at compilation.seal.err (/tmp/3694173/ncc/node_modules/@zeit/ncc/webpack/lib/Compiler.js:549:30) reported: true }
2018-11-23T07:08:25.646Z worker exited with code 0 and signal null

Webpack options like allow top-level require can help with this issue.

CC @igorklopov

package issue

Most helpful comment

Fixed by #43

All 5 comments

Seems like the issue is with path-platform, not got.

Fixed by #43

Broken again in 0.8.0

Just tested this here and it does seem to be broken in the latest release actually.

Turns out this was due to my running a broken build while working on other things :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GiladShoham picture GiladShoham  路  3Comments

maku picture maku  路  3Comments

lucleray picture lucleray  路  3Comments

mrmckeb picture mrmckeb  路  5Comments

guybedford picture guybedford  路  5Comments