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
Then try ncc build index.js -o dist and get the following error:
Click to show output
```
ncc: Module directory "/Users/styfle/Desktop/ncc-broken/node_modules/got" attempted to require "electron" but could not be resolved, assuming external.
ncc: Module directory "/Users/styfle/Desktop/ncc-broken/node_modules/ws/lib" attempted to require "utf-8-validate" but could not be resolved, assuming external.
ncc: Module directory "/Users/styfle/Desktop/ncc-broken/node_modules/ws/lib" attempted to require "bufferutil" but could not be resolved, assuming external.
Error: Hash: e6543104c891a74ef2bc
Version: webpack 4.26.0
Time: 3353ms
Built at: 12/23/2018 11:42:17 PM
Asset Size Chunks Chunk Names
index.js 4.68 MiB 0 main
index.js.map 1.66 MiB 0 main
Entrypoint main = index.js index.js.map
[3] external "fs" 42 bytes {0} [built]
[7] external "util" 42 bytes {0} [built]
[9] external "path" 42 bytes {0} [built]
[18] external "os" 42 bytes {0} [built]
[23] ./node_modules/chromeless/dist/src/util.js 36.1 KiB {0} [built]
[52] ./node_modules/chromeless/dist/src/chrome/local.js 12 KiB {0} [built]
[53] ./node_modules/chrome-remote-interface/index.js 1.18 KiB {0} [built]
[111] ./node_modules/chromeless/dist/src/queue.js 5.42 KiB {0} [built]
[112] ./index.js 371 bytes {0} [built]
[113] ./node_modules/chromeless/dist/src/index.js 422 bytes {0} [built]
[114] ./node_modules/chromeless/dist/src/api.js 11.9 KiB {0} [built]
[127] ./node_modules/chrome-launcher/dist/index.js 424 bytes {0} [built]
[148] ./node_modules/chromeless/dist/src/chrome/local-runtime.js 35.1 KiB {0} [built]
[149] ./node_modules/cuid/index.js 2.12 KiB {0} [built]
[151] ./node_modules/aws-sdk/lib/aws.js 159 bytes {0} [built]
+ 838 hidden modules
WARNING in ./node_modules/keyv/src/index.js 18:14-40
Critical dependency: the request of a dependency is an expression
@ ./node_modules/cacheable-request/src/index.js
@ ./node_modules/got/index.js
@ ./node_modules/chromeless/dist/src/chrome/remote.js
@ ./node_modules/chromeless/dist/src/api.js
@ ./node_modules/chromeless/dist/src/index.js
@ ./index.js
ERROR in ./node_modules/mqtt/mqtt.js
Module build failed (from (webpack)/ncc/loaders/relocate-loader.js):
SyntaxError: Unexpected character '#' (1:0)
at Parser.re.raise (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/loaders/relocate-loader.js:1:327209)
at Parser.de.getTokenFromCode (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/loaders/relocate-loader.js:1:358665)
at Parser.de.readToken (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/loaders/relocate-loader.js:1:353133)
at Parser.de.nextToken (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/loaders/relocate-loader.js:1:352974)
at Parser.parse (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/loaders/relocate-loader.js:1:282448)
at Function.parse (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/loaders/relocate-loader.js:1:283141)
at Object.parse (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/loaders/relocate-loader.js:1:365103)
at Object.e.exports (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/loaders/relocate-loader.js:1:125406)
@ ./node_modules/chromeless/dist/src/chrome/remote.js 38:13-28
@ ./node_modules/chromeless/dist/src/api.js
@ ./node_modules/chromeless/dist/src/index.js
@ ./index.js
ERROR in ./node_modules/chromeless/dist/src/util.js
Module not found: Error: Can't resolve '../package.json' in '/Users/styfle/Desktop/ncc-broken/node_modules/chromeless/dist/src'
@ ./node_modules/chromeless/dist/src/util.js 55:15-41
@ ./node_modules/chromeless/dist/src/index.js
@ ./index.js
at E.run (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/index.js:1:809755)
at t (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/index.js:1:831937)
at hooks.done.callAsync.r (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/index.js:1:832165)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/index.js:1:132993), :6:1)
at AsyncSeriesHook.lazyCompileHook (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/index.js:1:124556)
at n (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/index.js:1:832125)
at hooks.afterCompile.callAsync.t (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/index.js:1:836702)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/index.js:1:132993), :6:1)
at AsyncSeriesHook.lazyCompileHook (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/index.js:1:124556)
at n.seal.t (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/index.js:1:836662)
</details>
/cc @rauchg
The text was updated successfully, but these errors were encountered:
With #196 merged the bug here then becomes a package.json not found issue due to an untraceable require from the following code:
if(fs.existsSync(path.join(__dirname,'../package.json'))){// development (look in /src)returnrequire('../package.json').version;}else{// production (look in /dist/src)returnrequire('../../package.json').version;}
A fix for the above might be to extend the not found require inlining to cover an fs.exists sync conditional test pattern match as well.
Create a file called
index.js
which works fine when runningnode index.js
.Then try
ncc build index.js -o dist
and get the following error:Click to show output
``` ncc: Module directory "/Users/styfle/Desktop/ncc-broken/node_modules/got" attempted to require "electron" but could not be resolved, assuming external. ncc: Module directory "/Users/styfle/Desktop/ncc-broken/node_modules/ws/lib" attempted to require "utf-8-validate" but could not be resolved, assuming external. ncc: Module directory "/Users/styfle/Desktop/ncc-broken/node_modules/ws/lib" attempted to require "bufferutil" but could not be resolved, assuming external. Error: Hash: e6543104c891a74ef2bc Version: webpack 4.26.0 Time: 3353ms Built at: 12/23/2018 11:42:17 PM Asset Size Chunks Chunk Names index.js 4.68 MiB 0 main index.js.map 1.66 MiB 0 main Entrypoint main = index.js index.js.map [3] external "fs" 42 bytes {0} [built] [7] external "util" 42 bytes {0} [built] [9] external "path" 42 bytes {0} [built] [18] external "os" 42 bytes {0} [built] [23] ./node_modules/chromeless/dist/src/util.js 36.1 KiB {0} [built] [52] ./node_modules/chromeless/dist/src/chrome/local.js 12 KiB {0} [built] [53] ./node_modules/chrome-remote-interface/index.js 1.18 KiB {0} [built] [111] ./node_modules/chromeless/dist/src/queue.js 5.42 KiB {0} [built] [112] ./index.js 371 bytes {0} [built] [113] ./node_modules/chromeless/dist/src/index.js 422 bytes {0} [built] [114] ./node_modules/chromeless/dist/src/api.js 11.9 KiB {0} [built] [127] ./node_modules/chrome-launcher/dist/index.js 424 bytes {0} [built] [148] ./node_modules/chromeless/dist/src/chrome/local-runtime.js 35.1 KiB {0} [built] [149] ./node_modules/cuid/index.js 2.12 KiB {0} [built] [151] ./node_modules/aws-sdk/lib/aws.js 159 bytes {0} [built] + 838 hidden modulesWARNING in ./node_modules/keyv/src/index.js 18:14-40
Critical dependency: the request of a dependency is an expression
@ ./node_modules/cacheable-request/src/index.js
@ ./node_modules/got/index.js
@ ./node_modules/chromeless/dist/src/chrome/remote.js
@ ./node_modules/chromeless/dist/src/api.js
@ ./node_modules/chromeless/dist/src/index.js
@ ./index.js
ERROR in ./node_modules/mqtt/mqtt.js
Module build failed (from (webpack)/ncc/loaders/relocate-loader.js):
SyntaxError: Unexpected character '#' (1:0)
at Parser.re.raise (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/loaders/relocate-loader.js:1:327209)
at Parser.de.getTokenFromCode (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/loaders/relocate-loader.js:1:358665)
at Parser.de.readToken (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/loaders/relocate-loader.js:1:353133)
at Parser.de.nextToken (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/loaders/relocate-loader.js:1:352974)
at Parser.parse (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/loaders/relocate-loader.js:1:282448)
at Function.parse (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/loaders/relocate-loader.js:1:283141)
at Object.parse (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/loaders/relocate-loader.js:1:365103)
at Object.e.exports (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/loaders/relocate-loader.js:1:125406)
@ ./node_modules/chromeless/dist/src/chrome/remote.js 38:13-28
@ ./node_modules/chromeless/dist/src/api.js
@ ./node_modules/chromeless/dist/src/index.js
@ ./index.js
ERROR in ./node_modules/chromeless/dist/src/util.js
Module not found: Error: Can't resolve '../package.json' in '/Users/styfle/Desktop/ncc-broken/node_modules/chromeless/dist/src'
@ ./node_modules/chromeless/dist/src/util.js 55:15-41
@ ./node_modules/chromeless/dist/src/index.js
@ ./index.js
at E.run (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/index.js:1:809755)
at t (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/index.js:1:831937)
at hooks.done.callAsync.r (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/index.js:1:832165)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/index.js:1:132993), :6:1)
at AsyncSeriesHook.lazyCompileHook (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/index.js:1:124556)
at n (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/index.js:1:832125)
at hooks.afterCompile.callAsync.t (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/index.js:1:836702)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/index.js:1:132993), :6:1)
at AsyncSeriesHook.lazyCompileHook (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/index.js:1:124556)
at n.seal.t (/usr/local/lib/node_modules/@zeit/ncc/dist/ncc/index.js:1:836662)
The text was updated successfully, but these errors were encountered: