shoaibkhan94 / reactstrap-formik

Reactstrap Form Components for Formik
https://shoaibkhan94.github.io/reactstrap-formik/
MIT License
31 stars 18 forks source link

Error : Cannot use import statement outside a module #16

Open Arshazar opened 4 years ago

Arshazar commented 4 years ago

I use Afterjs and when I load a page with reactstrap-formik used in it, I encounter the error. Its stack :

node_modules/reactstrap-formik/dist/index.js:1\nimport ReactstrapInput from './ReactstrapFormikInput';\n^^^^^^\n\nSyntaxError: Cannot use import statement outside a module\n at compileFunction ()\n at wrapSafe (internal/modules/cjs/loader.js:1072:16)\n at Module._compile (internal/modules/cjs/loader.js:1122:27)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)\n at Module.load (internal/modules/cjs/loader.js:1002:32)\n at Function.Module._load (internal/modules/cjs/loader.js:901:14)\n at Module.require (internal/modules/cjs/loader.js:1044:19)\n at require (internal/modules/cjs/helpers.js:77:18)\n at Object.reactstrap-formik (.../external \"reactstrap-formik\":1:1)\n at __webpack_require__ (.../build/webpack:/webpack/bootstrap:754:1)"

But when I switch to the page by router from another page not using the module, everything's fine...

gruffT commented 3 years ago

@Arshazar I found a work around by re-transpiling from source in my project. Hope this helps you.

wtLau commented 3 years ago

I have a similar problem. Not sure what's the issue and I do not wish to transpile node_modules.