1

enter image description here

Laravel mix can not compile import() function.

8
  • You can try to install plugin babel-plugin-syntax-dynamic-import Commented Dec 25, 2018 at 9:47
  • At .babelrc file adding that plugin { "plugins": ["syntax-dynamic-import"] } Commented Dec 25, 2018 at 9:48
  • @QuỳnhNguyễn not working.... Commented Dec 25, 2018 at 10:22
  • Can you please show babel version you using? Commented Dec 25, 2018 at 10:33
  • If you using @babel/core -> try @babel/plugin-syntax-dynamic-import plugin instead of. Commented Dec 25, 2018 at 10:34

1 Answer 1

1

You got this import() Unexpected token because missing babel plugin allow parsing of import().

  1. Please try to install one in either:

  2. Create or edit your .babelrc file in your project root.

    {
        "plugins": ["syntax-dynamic-import"]
    }
    

And try to run your project again.

Hope this work for you and for other members.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.