Skip to content

cannot import axios v1.0.0 and up in Liferay Platform project #1047

Open
@myou11

Description

@myou11

Issue type

  • 🐛 Bug report

Description

Axios v1.0.0 and up causes the React app to not work. It appears to be an import/export issue. If I have the axios import in the file, this error appears: Uncaught SyntaxError: import declarations may only appear at top level of a module. However, if i remove the axios import, then the error does not appear.

Desired behavior:
Be able to import Axios v1.0.0 and up

Current behavior:
Importing Axios v1.0.0 and up causes the React app to not load

Repro instructions (if applicable):

  • Create a Liferay Platform project following the instructions here
    • I used npx @liferay/cli new new-project-name
  • yarn add axios
  • add import axios from "axios" in AppComponent.js
  • yarn deploy
  • see Uncaught SyntaxError: import declarations may only appear at top level of a module in the console

Other information (environment, versions etc):

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