Unexpected token export
See original GitHub issueAs part of reactstrap, we are facing this error, when running jest tests. Any help will be appreciated.
/Users/venelin/projects/stylbum-web-v2/node_modules/react-popper/lib/react-popper.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){export { default as Manager } from './Manager';
^^^^^^
SyntaxError: Unexpected token export
at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/ScriptTransformer.js:289:17)
at Object.<anonymous> (node_modules/reactstrap/dist/reactstrap.cjs.js:14:19)
at Object.<anonymous> (src/Auth/Login/Login.jsx:5:19)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:16
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Getting Unexpected Token Export - javascript - Stack Overflow
I solved it by declaring a type as a module when adding a script tag in my index. html file.
Read more >How to fix SyntaxError: Unexpected token 'export' in JavaScript?
In this article, we are going to see How to fix SyntaxError: Unexpected token 'export' in JavaScript? and what are Es6 modules.
Read more >SyntaxError: Unexpected token 'export' in JavaScript [Fixed]
To solve the "Uncaught SyntaxError Unexpected token 'export'" error, set the type of your <script /> tags to module , e.g. <script type="module"...
Read more >How to Solve Unexpected Token 'export' Error in JavaScript
To solve the "Uncaught SyntaxError Unexpected token 'export'" error, set the type property to module in your package.json file.
Read more >How to Fix „Uncaught SyntaxError: Unexpected token 'export
Using type="module" on the <script> tag solved the „Unexpected token export ” error. The browser runs the imported JavaScript without issues.
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
@nickmccurdy Use reactstrap": “5.0.0-beta” version for a short.
This should be fixed in 0.8.3