You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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):
The text was updated successfully, but these errors were encountered:
Not really, because unfortunately we haven't had time to reproduce it.
Definitely more information to make a good diagnostic of what is causing the error would be helpful and make things go faster. Seeing the error it looks like the tool is using a JS file from axios that is not intended to be used in the browser. That is usually due to browser field configuration or something similar...
Issue type
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):
npx @liferay/cli new new-project-name
yarn add axios
import axios from "axios"
inAppComponent.js
yarn deploy
Uncaught SyntaxError: import declarations may only appear at top level of a module
in the consoleOther information (environment, versions etc):
The text was updated successfully, but these errors were encountered: