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

SyntaxError: 'import' and 'export' may only appear at the top level #211

Open
naisargparmar opened this issue Nov 23, 2020 · 0 comments
Open

Comments

@naisargparmar
Copy link

I am using react 16.8.6. My code is working fine but I am getting syntax error. jsfmt don't support below import code.
exportCsv = () => {
this.setState({ isExporting: true });
import('./exportToCsvV2').then(bundle => {
try {
// some code
} catch (e) {
throw e;
}
});
};

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