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 await import not supported #40

Open
uptonking opened this issue May 24, 2021 · 0 comments
Open

dynamic await import not supported #40

uptonking opened this issue May 24, 2021 · 0 comments

Comments

@uptonking
Copy link

@egoist @c4software
after i changed example/index.js to the following, npx webpack run failed.

// import template from 'https://unpkg.com/lodash-es/template'

async function testLogAsyncImport() {
  const {
    default: template
  } = await import('https://unpkg.com/lodash-es/template')

  console.log(template(`Hello <%= name %>`)({ name: 'EGOIST' }))
}

testLogAsyncImport()

the error message

ERROR in ./index.js 6:12
Module parse failed: Unexpected token (6:12)
You may need an appropriate loader to handle this file type.
|   const {
|     default: template
>   } = await import('https://unpkg.com/lodash-es/template')
| 
|   console.log(template(`Hello <%= name %>`)({ name: 'EGOIST' }))

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

1 participant