I have a long "warning" or message at build phase with my project. (see below)
Also, I'm using CircleCI, and it seems this warning block the server compilation. (Not sure though, i don't fine the exact reason)
> Emitted warnings from webpack
{ ModuleDependencyWarning: Critical dependency: the request of a dependency is an expression
at Compilation.reportDependencyErrorsAndWarnings (C:\Users\Romain\Documents\GitHub\front\node_modules\next\node_modules\webpack\lib\Compilation.js:1361:23)
at Compilation.finish (C:\Users\Romain\Documents\GitHub\front\node_modules\next\node_modules\webpack\lib\Compilation.js:1167:9)
at hooks.make.callAsync.err (C:\Users\Romain\Documents\GitHub\front\node_modules\next\node_modules\webpack\lib\Compiler.js:622:17)
at _err0 (eval at create (C:\Users\Romain\Documents\GitHub\front\node_modules\tapable\lib\HookCodeFactory.js:32:10), <anonymous>:11:1)
at Promise.all.then (C:\Users\Romain\Documents\GitHub\front\node_modules\next\node_modules\webpack\lib\DynamicEntryPlugin.js:74:20)
at processTicksAndRejections (internal/process/next_tick.js:81:5)
details:
' at CommonJsRequireContextDependency.getWarnings (C:\\Users\\Romain\\Documents\\GitHub\\front\\node_modules\\next\\node_modules\\webpack\\lib\\dependencies\\ContextDependency.js:40:18)\n at Compilation.reportDependencyErrorsAndWarnings (C:\\Users\\Romain\\Documents\\GitHub\\front\\node_modules\\next\\node_modules\\webpack\\lib\\Compilation.js:1356:24)\n at Compilation.finish (C:\\Users\\Romain\\Docu
ments\\GitHub\\front\\node_modules\\next\\node_modules\\webpack\\lib\\Compilation.js:1167:9)\n at hooks.make.callAsync.err (C:\\Users\\Romain\\Documents\\GitHub\\front\\node_modules\\next\\node_modules\\webpack\\lib\\Compiler.js:622:17)\n at _err0 (eval at create (C:\\Users\\Romain\\Documents\\GitHub\\front\\node_modules\\tapable\\lib\\HookCodeFactory.js:32:10), <anonymous>:11:1)\n at Promise.all.then (
C:\\Users\\Romain\\Documents\\GitHub\\front\\node_modules\\next\\node_modules\\webpack\\lib\\DynamicEntryPlugin.js:74:20)\n at processTicksAndRejections (internal/process/next_tick.js:81:5)',
missing: undefined,
origin:
NormalModule {
dependencies:
[ [ConstDependency],
[CommonJsRequireDependency],
[RequireHeaderDependency],
[CommonJsRequireDependency],
[RequireHeaderDependency] ],
blocks: [],
variables: [],
type: 'javascript/auto',
context:
'C:\\Users\\Romain\\Documents\\GitHub\\front\\node_modules\\encoding\\lib',
debugId: 18577,
hash: '0c134e7e3fe12b06cf62eb4de6121f0a',
renderedHash: '0c134e7e3fe12b06cf62',
resolveOptions: {},
factoryMeta: {},
warnings: [],
errors: [],
buildMeta: { providedExports: true },
buildInfo:
{ cacheable: true,
fileDependencies: [Set],
contextDependencies: Set {},
strict: true,
temporaryProvidedExports: false },
reasons: [ [ModuleReason] ],
_chunks:
SortableSet [Set] {
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
_sortFn: [Function: sortById],
_lastActiveSortFn: [Function: sortById],
_cache: undefined,
_cacheOrderIndependent: undefined },
id: 'M2TY',
index: 985,
index2: 1003,
depth: 6,
issuer:
NormalModule {
dependencies: [Array],
blocks: [],
variables: [],
type: 'javascript/auto',
context:
'C:\\Users\\Romain\\Documents\\GitHub\\front\\node_modules\\node-fetch\\lib',
debugId: 17897,
hash: '48c43f43ca17e24fe3b921b7ac5c55c4',
renderedHash: '48c43f43ca17e24fe3b9',
resolveOptions: {},
factoryMeta: {},
warnings: [],
errors: [],
buildMeta: [Object],
buildInfo: [Object],
reasons: [Array],
_chunks: [SortableSet],
id: 'lrmY',
index: 983,
index2: 1004,
depth: 5,
issuer: [NormalModule],
profile: undefined,
prefetched: false,
built: true,
used: true,
usedExports: [Array],
optimizationBailout: [Array],
_rewriteChunkInReasons: undefined,
useSourceMap: false,
_source: [OriginalSource],
request:
'C:\\Users\\Romain\\Documents\\GitHub\\front\\node_modules\\node-fetch\\lib\\index.js',
userRequest:
'C:\\Users\\Romain\\Documents\\GitHub\\front\\node_modules\\node-fetch\\lib\\index.js',
rawRequest: 'node-fetch',
binary: false,
parser: [Parser],
generator: JavascriptGenerator {},
resource:
'C:\\Users\\Romain\\Documents\\GitHub\\front\\node_modules\\node-fetch\\lib\\index.js',
matchResource: undefined,
loaders: [],
error: null,
_buildHash: 'ea04824d38ae637a89f18ace80269d06',
buildTimestamp: 1550652014432,
_cachedSources: [Map],
lineToLine: false,
_lastSuccessfulBuildMeta: [Object],
_ast: null },
profile: undefined,
prefetched: false,
built: true,
used: true,
usedExports: true,
optimizationBailout:
[ 'ModuleConcatenation bailout: Module is not an ECMAScript module' ],
_rewriteChunkInReasons: undefined,
useSourceMap: false,
_source:
OriginalSource {
_value:
"'use strict';\n\nvar iconvLite = require('iconv-lite');\n// Load Iconv from an external file to be able to disable Iconv for webpack\n// Add /\\/iconv-loader$/ to webpack.IgnorePlugin to ignore it\nvar Iconv = require('./iconv-loader');\n\n// Expose to the world\nmodule.exports.convert = convert;\n\n/**\n * Convert encoding of an UTF-8 string or a buffer\n *\n * @param {String|Buffer} str String to be
converted\n * @param {String} to Encoding to be converted to\n * @param {String} [from='UTF-8'] Encoding to be converted from\n * @param {Boolean} useLite If set to ture, force to use iconvLite\n * @return {Buffer} Encoded string\n */\nfunction convert(str, to, from, useLite) {\n from = checkEncoding(from || 'UTF-8');\n to = checkEncoding(to || 'UTF-8');\n str = str || '';\n\n var result;\n\n if (
from !== 'UTF-8' && typeof str === 'string') {\n str = new Buffer(str, 'binary');\n }\n\n if (from === to) {\n if (typeof str === 'string') {\n result = new Buffer(str);\n } else {\n result = str;\n }\n } else if (Iconv && !useLite) {\n try {\n result = convertIconv(str, to, from);\n } catch (E) {\n console.error(E);\n
try {\n result = convertIconvLite(str, to, from);\n } catch (E) {\n console.error(E);\n result = str;\n }\n }\n } else {\n try {\n result = convertIconvLite(str, to, from);\n } catch (E) {\n console.error(E);\n result = str;\n }\n }\n\n\n if (typeof result === 'stri
ng') {\n result = new Buffer(result, 'utf-8');\n }\n\n return result;\n}\n\n/**\n * Convert encoding of a string with node-iconv (if available)\n *\n * @param {String|Buffer} str String to be converted\n * @param {String} to Encoding to be converted to\n * @param {String} [from='UTF-8'] Encoding to be converted from\n * @return {Buffer} Encoded string\n */\nfunction convertIconv(str, to, from) {\n
var response, iconv;\n iconv = new Iconv(from, to + '//TRANSLIT//IGNORE');\n response = iconv.convert(str);\n return response.slice(0, response.length);\n}\n\n/**\n * Convert encoding of astring with iconv-lite\n *\n * @param {String|Buffer} str String to be converted\n * @param {String} to Encoding to be converted to\n * @param {String} [from='UTF-8'] Encoding to be converted from\n * @return {Buffer
} Encoded string\n */\nfunction convertIconvLite(str, to, from) {\n if (to === 'UTF-8') {\n return iconvLite.decode(str, from);\n } else if (from === 'UTF-8') {\n return iconvLite.encode(str, to);\n } else {\n return iconvLite.encode(iconvLite.decode(str, from), to);\n }\n}\n\n/**\n * Converts charset name if needed\n *\n * @param {String} name Character set\n * @return {String}
Character set name\n */\nfunction checkEncoding(name) {\n return (name || '').toString().trim().\n replace(/^latin[\\-_]?(\\d+)$/i, 'ISO-8859-$1').\n replace(/^win(?:dows)?[\\-_]?(\\d+)$/i, 'WINDOWS-$1').\n replace(/^utf[\\-_]?(\\d+)$/i, 'UTF-$1').\n replace(/^ks_c_5601\\-1987$/i, 'CP949').\n replace(/^us[\\-_]?ascii$/i, 'ASCII').\n toUpperCase();\n}\n",
_name:
'C:\\Users\\Romain\\Documents\\GitHub\\front\\node_modules\\encoding\\lib\\encoding.js' },
request:
'C:\\Users\\Romain\\Documents\\GitHub\\front\\node_modules\\encoding\\lib\\encoding.js',
userRequest:
'C:\\Users\\Romain\\Documents\\GitHub\\front\\node_modules\\encoding\\lib\\encoding.js',
rawRequest: 'encoding',
binary: false,
parser:
Parser {
_pluginCompat: [SyncBailHook],
hooks: [Object],
options: {},
sourceType: 'auto',
scope: undefined,
state: undefined,
comments: undefined },
generator: JavascriptGenerator {},
resource:
'C:\\Users\\Romain\\Documents\\GitHub\\front\\node_modules\\encoding\\lib\\encoding.js',
matchResource: undefined,
loaders: [],
error: null,
_buildHash: 'b35e0016b3e51892c524b6ece52c538d',
buildTimestamp: 1550652015961,
_cachedSources: Map { 'javascript' => [Object] },
lineToLine: false,
_lastSuccessfulBuildMeta: { providedExports: true },
_ast: null },
dependencies: undefined,
module:
NormalModule {
dependencies: [ [ConstDependency], [CommonJsRequireContextDependency] ],
blocks: [],
variables: [],
type: 'javascript/auto',
context:
'C:\\Users\\Romain\\Documents\\GitHub\\front\\node_modules\\encoding\\lib',
debugId: 18751,
hash: '8fa16c8941247d0a4eb756c5737d3e30',
renderedHash: '8fa16c8941247d0a4eb7',
resolveOptions: {},
factoryMeta: {},
warnings: [],
errors: [],
buildMeta: { providedExports: true },
buildInfo:
{ cacheable: true,
fileDependencies: [Set],
contextDependencies: Set {},
strict: true,
temporaryProvidedExports: false },
reasons: [ [ModuleReason] ],
_chunks:
SortableSet [Set] {
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
[Chunk],
_sortFn: [Function: sortById],
_lastActiveSortFn: [Function: sortById],
_cache: undefined,
_cacheOrderIndependent: undefined },
id: 'B/aH',
index: 1008,
index2: 1002,
depth: 7,
issuer:
NormalModule {
dependencies: [Array],
blocks: [],
variables: [],
type: 'javascript/auto',
context:
'C:\\Users\\Romain\\Documents\\GitHub\\front\\node_modules\\encoding\\lib',
debugId: 18577,
hash: '0c134e7e3fe12b06cf62eb4de6121f0a',
renderedHash: '0c134e7e3fe12b06cf62',
resolveOptions: {},
factoryMeta: {},
warnings: [],
errors: [],
buildMeta: [Object],
buildInfo: [Object],
reasons: [Array],
_chunks: [SortableSet],
id: 'M2TY',
index: 985,
index2: 1003,
depth: 6,
issuer: [NormalModule],
profile: undefined,
prefetched: false,
built: true,
used: true,
usedExports: true,
optimizationBailout: [Array],
_rewriteChunkInReasons: undefined,
useSourceMap: false,
_source: [OriginalSource],
request:
'C:\\Users\\Romain\\Documents\\GitHub\\front\\node_modules\\encoding\\lib\\encoding.js',
userRequest:
'C:\\Users\\Romain\\Documents\\GitHub\\front\\node_modules\\encoding\\lib\\encoding.js',
rawRequest: 'encoding',
binary: false,
parser: [Parser],
generator: JavascriptGenerator {},
resource:
'C:\\Users\\Romain\\Documents\\GitHub\\front\\node_modules\\encoding\\lib\\encoding.js',
matchResource: undefined,
loaders: [],
error: null,
_buildHash: 'b35e0016b3e51892c524b6ece52c538d',
buildTimestamp: 1550652015961,
_cachedSources: [Map],
lineToLine: false,
_lastSuccessfulBuildMeta: [Object],
_ast: null },
profile: undefined,
prefetched: false,
built: true,
used: true,
usedExports: true,
optimizationBailout:
[ 'ModuleConcatenation bailout: Module is not an ECMAScript module' ],
_rewriteChunkInReasons: undefined,
useSourceMap: false,
_source:
OriginalSource {
_value:
"'use strict';\n\nvar iconv_package;\nvar Iconv;\n\ntry {\n // this is to fool browserify so it doesn't try (in vain) to install iconv.\n iconv_package = 'iconv';\n Iconv = require(iconv_package).Iconv;\n} catch (E) {\n // node-iconv not present\n}\n\nmodule.exports = Iconv;\n",
_name:
'C:\\Users\\Romain\\Documents\\GitHub\\front\\node_modules\\encoding\\lib\\iconv-loader.js' },
request:
'C:\\Users\\Romain\\Documents\\GitHub\\front\\node_modules\\encoding\\lib\\iconv-loader.js',
userRequest:
'C:\\Users\\Romain\\Documents\\GitHub\\front\\node_modules\\encoding\\lib\\iconv-loader.js',
rawRequest: './iconv-loader',
binary: false,
parser:
Parser {
_pluginCompat: [SyncBailHook],
hooks: [Object],
options: {},
sourceType: 'auto',
scope: undefined,
state: undefined,
comments: undefined },
generator: JavascriptGenerator {},
resource:
'C:\\Users\\Romain\\Documents\\GitHub\\front\\node_modules\\encoding\\lib\\iconv-loader.js',
matchResource: undefined,
loaders: [],
error: null,
_buildHash: 'b7e65ec76fb5055e9c1d93edadfc9d54',
buildTimestamp: 1550652016137,
_cachedSources: Map { 'javascript' => [Object] },
lineToLine: false,
_lastSuccessfulBuildMeta: { providedExports: true },
_ast: null },
name: 'ModuleDependencyWarning',
loc:
SourceLocation {
start: Position { line: 9, column: 12 },
end: Position { line: 9, column: 34 } },
error:
{ CriticalDependencyWarning: Critical dependency: the request of a dependency is an expression
at CommonJsRequireContextDependency.getWarnings (C:\Users\Romain\Documents\GitHub\front\node_modules\next\node_modules\webpack\lib\dependencies\ContextDependency.js:40:18)
at Compilation.reportDependencyErrorsAndWarnings (C:\Users\Romain\Documents\GitHub\front\node_modules\next\node_modules\webpack\lib\Compilation.js:1356:24)
at Compilation.finish (C:\Users\Romain\Documents\GitHub\front\node_modules\next\node_modules\webpack\lib\Compilation.js:1167:9)
at hooks.make.callAsync.err (C:\Users\Romain\Documents\GitHub\front\node_modules\next\node_modules\webpack\lib\Compiler.js:622:17)
at _err0 (eval at create (C:\Users\Romain\Documents\GitHub\front\node_modules\tapable\lib\HookCodeFactory.js:32:10), <anonymous>:11:1)
at Promise.all.then (C:\Users\Romain\Documents\GitHub\front\node_modules\next\node_modules\webpack\lib\DynamicEntryPlugin.js:74:20)
at processTicksAndRejections (internal/process/next_tick.js:81:5)
details: undefined,
missing: undefined,
origin: undefined,
dependencies: undefined,
module: undefined,
name: 'CriticalDependencyWarning',
message:
'Critical dependency: the request of a dependency is an expression' } }
โ /
โ /_app
โ /_document
โ /_error
โ /account
โ /account-confirmation
โ /buffet
โ /business
โ /gift
โ /group-lesson
โ /individual
โ /invite
โ /invite-business
โ /join
โ /login
โ /mission
โ /not-found
โ /payment
โ /presskit
โ /profile
โ /reset-password
โ /reset-password-request
โ /search
โ /sign-up
โ /subscription
โ /team
โ /terms
โ /terms-pro
โ /testimony
โ /work-council
โ /working-day
โ /workshop
โ /workshop-business
โ /workshop-edit
โ /workshop-new
Done in 188.49s.
Error on CircleCI :
#!/bin/bash -eo pipefail
yarn build
yarn run v1.5.1
$ next build && tsc --project tsconfig.server.json
[19:05:51] [webpackbar] [INFO] Compiling Client
> Using external babel configuration
> Location: "/home/circleci/project/.babelrc"
Total precache size is about 0 B for 0 resources.
[19:06:37] [webpackbar] [SUCCESS] Client: Compiled successfully in 46.40s
[19:06:38] [webpackbar] [INFO] Compiling Server
Too long with no output (exceeded 10m0s)
Exec on computer is :
โ Client
Compiled successfully in 1.05m
โ Server
Compiled successfully in 1.70m
The message is clearer on next@canary.
@timneutkens
I have the same error, do you mean we should use canary?
I have the same error as well. Used next@canary. The error message did not improve.
@AryanJ-NYC instead of saying "same error" please provide a reproduction in a new issue. It's unlikely this is the same issue.
Most helpful comment
@timneutkens
I have the same error, do you mean we should use canary?