Skip to content

ENAMETOOLONG for import()'d bundles #6426

Closed

Description

@gdborton

Do you want to request a feature or report a bug?
bug

What is the current behavior?
Webpack is generating the following error when running our build:

Error: Error: ENAMETOOLONG: name too long, open '/mnt/tmp/d20180130-23474-fmx2zd/monorail-solano-ghe/public/static/AsyncTwoFactorModal~LuxuryCreateInspection_async~LuxuryListingStatusDashboard_async~SaveToListModal~UserChallengesInline~UserChallengesModalWrapper~business_profile_modal_content~causesAdminCampaignModal~causesAdminCauseModal~mt-guest-services-RestaurantBookContainer~mt-guest-services-confirmAndPayContainer~reauthModal_async-async-33b40edd34cd932e7a21.js'
    at multiCompiler.run (/mnt/tmp/d20180130-23474-fmx2zd/monorail-solano-ghe/webpack/compile.js:16:11)
    at runWithDependencies (/mnt/tmp/d20180130-23474-fmx2zd/monorail-solano-ghe/node_modules/webpack/lib/MultiCompiler.js:223:20)
    at /mnt/tmp/d20180130-23474-fmx2zd/monorail-solano-ghe/node_modules/async/dist/async.js:1074:9
    at /mnt/tmp/d20180130-23474-fmx2zd/monorail-solano-ghe/node_modules/async/dist/async.js:421:16
    at iteratorCallback (/mnt/tmp/d20180130-23474-fmx2zd/monorail-solano-ghe/node_modules/async/dist/async.js:996:13)
    at /mnt/tmp/d20180130-23474-fmx2zd/monorail-solano-ghe/node_modules/async/dist/async.js:906:16
    at /mnt/tmp/d20180130-23474-fmx2zd/monorail-solano-ghe/node_modules/async/dist/async.js:1071:13
    at fn (/mnt/tmp/d20180130-23474-fmx2zd/monorail-solano-ghe/node_modules/webpack/lib/MultiCompiler.js:166:21)
    at compiler.run (/mnt/tmp/d20180130-23474-fmx2zd/monorail-solano-ghe/node_modules/webpack/lib/MultiCompiler.js:218:21)
    at emitAssets.err (/mnt/tmp/d20180130-23474-fmx2zd/monorail-solano-ghe/node_modules/webpack/lib/Compiler.js:179:20)

It looks like webpack is combining several of our async imported file names into one.

If the current behavior is a bug, please provide the steps to reproduce.
I don't know how to recreate outside of running our build.

What is the expected behavior?
The above error shouldn't be generated.

If this is a feature request, what is motivation or use case for changing the behavior?

Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.
node 8.9.1, npm 5.6.0, webpack 4 beta, mac osx

Activity

  1. sokra commented on Jan 31, 2018

    @sokra
    Member

    Workaround:

    optimization.splitChunks.name: false

    or

    output.chunkFilename: "[chunkhash].js" <- no [name]


    We should limit the automatically generated name to a maximum length. In these cases we can omit the name, that doesn't hurt.

  2. sokra commented on Jan 31, 2018

    @sokra
    Member

    Somebody can send a PR

  3. added a commit that references this issue on Jan 31, 2018
    c08995c
  4. delagen commented on Feb 1, 2018

    @delagen

    @sokra This issue also when use

    import(/* webpackChunkName: "chunkName1" */"./chunk1")
    

    with chunkName1~chunkName2......~chunkNameN path

  5. added this to the webpack 4 milestone on Feb 1, 2018
  6. added 2 commits that reference this issue on Feb 2, 2018
    48e370e
    6ebdc6b
  7. gdborton commented on Feb 6, 2018

    @gdborton
    ContributorAuthor
    optimization: {
          splitChunks: {
            name: false,
          },
        },
    

    failed our build with:

    /mnt/tmp/d20180206-22284-1rqlu73/monorail-solano-ghe/node_modules/webpack/lib/webpack.js:19
    		throw new WebpackOptionsValidationError(webpackOptionsValidationErrors);
    		^
    
    WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
     - configuration.optimization.splitChunks should be one of these:
       false | object { chunks?, minSize?, minChunks?, maxAsyncRequests?, maxInitialRequests?, name?, cacheGroups? }
       -> Optimize duplication and caching by splitting chunks by shared modules and cache group
       Details:
        * configuration.optimization.splitChunks should be false
        * configuration.optimization.splitChunks.name should be true
        * configuration.optimization.splitChunks.name should be an instance of function
        * configuration.optimization.splitChunks.name should be a string.
    

    Trying the other workaround now.

  8. added a commit that references this issue on Feb 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions