Skip to content

Need update docs: Dynamic import doesn't work as shown in the docs #2154

Closed
@webpack-bot

Description

@webpack-bot

Bug report

What is the current behavior?
As shown in the documentation about dynamic imports, we should get lodash from import(/* webpackChunkName: "lodash" */ 'lodash').then(_ => doSomething()); but instead the lodash value is wrapped inside a namespace with default property.

If the current behavior is a bug, please provide the steps to reproduce.

What is the expected behavior?
The docs should show that we need to access _ via namespace.default

Other relevant information:
webpack version: 4.8.3
Node.js version: 8.9.4
Operating System: Mac OS X
Additional tools:


This issue was moved from webpack/webpack#7302 by @sokra. Original issue was by @tiendo1011.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions