SyntaxError: 'import' and 'export' may only appear at the top level
See original GitHub issueJust installed latest, and am seeing:
SyntaxError: 'import' and 'export' may only appear at the top level (8656:0) while parsing /node_modules/filestack-js/build/browser/index.esm.js
I am using gulp, with babel to transpile to es2015, and this configuration works with other modules. Anything special about this module?
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
'import' and 'export' may only appear at the top level
I'm using webpack with vuejs. Webpack does its thing, but when I look at the outputted app.js file, it gives me this error....
Read more >'import' and 'export' may only appear at the top level | bobbyhadz
The error "import and export may only appear at the top level" occurs when we forget a closing brace when declaring a function...
Read more >How to fix: import and export may only appear at the top level
So I've setup a new Svelte project and install all the latest node modules. ... If you're developing a Svelte project, you're probably...
Read more >'import' and 'export' may only appear at the top level · Issue #304
Error: 'import' and 'export' may only appear at the top level abc: ../../node_modules/lodash-es/isBuffer.js (1:0) abc: 1: import root from ' ...
Read more >javascript import declarations may only appear at top level of a ...
The above line rectifies the syntaxError: Import declarations may only appear at top level of module. It's because when you import, the file...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ninjaPixel @StorytellerCZ @graphographer The newest version is using filestack-js 2.0.5 and it should fix this problem.
Here’s a really dirty workaround, for those experiencing the same issue with
filestack-react
and Meteor.1 - Remove
filestack-react
from your project:2 - Add
filestack-js
:3 - Create a new react component in your project, called
ReactFilestack.jsx
and paste in the code found here: https://github.com/filestack/filestack-react/blob/master/src/ReactFilestack.jsxThen change the import statement for
filestack
to point directly to/node_modules/filestack-js/build/browser/filestack.min.js
You can then use this new component in place of the
filestack-react
package.