Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic imports in 4.29.0 #8662

Closed
arunas-bendoraitis opened this issue Jan 21, 2019 · 2 comments
Closed

Dynamic imports in 4.29.0 #8662

arunas-bendoraitis opened this issue Jan 21, 2019 · 2 comments

Comments

@arunas-bendoraitis
Copy link

Bug report

After 4.29.0 was released (i had "webpack": "^4.25.1" in package.json) my build was failing because dynamic imports were not recognized. Got the following error:
Module parse failed: 'import' and 'export' may only appear at the top level.
I removed the caret from package json and with 4.25.1 it works as expected

What is the current behavior?
My build failed

If the current behavior is a bug, please provide the steps to reproduce.
Not completely sure but this piece of code was not working:
if (urls.is('')) {
import(/*webpackChunkName: "dashboard" */'../dashboard');
}

What is the expected behavior?
Dynamic imports work as expected

Other relevant information:
webpack version:
Node.js version:
Operating System:
Additional tools:

@roblan
Copy link
Contributor

roblan commented Jan 21, 2019

I have slightly different error, but also with dynamic imports in 4.29.0

Module parse failed: Unexpected token You may need an appropriate loader to handle this file type.

line

var component = props.custom ? import( /* webpackChunkName: "dynamic-custom" */ './src/CustomDynamicModule').then(function (module) {

@sokra
Copy link
Member

sokra commented Jan 21, 2019

Duplicate of #8656

@sokra sokra marked this as a duplicate of #8656 Jan 21, 2019
@sokra sokra closed this as completed Jan 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants