Error console
/node_modules/reactstrap/lib/index.js:1
import _Container from ‘./Container’;
^^^^^^
SyntaxError: Cannot use import statement outside a module
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1176:20)
at Module._compile (node:internal/modules/cjs/loader:1218:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Module._load (node:internal/modules/cjs/loader:958:12)
at Module.require (node:internal/modules/cjs/loader:1141:19)
at require (node:internal/modules/cjs/helpers:110:18)
at Object.reactstrap (/home/rafael/Documentos/dev/academy/.next/server/pages/_app.js:715:18)
at webpack_require (/home/rafael/Documentos/dev/academy/.next/server/webpack-runtime.js:33:42)
Node.js v18.15.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
(https://i.stack.imgur.com/W7GGd.png)
Index.js for reactstrap
import _Container from './Container';
export { _Container as Container };
import _Row from './Row';
export { _Row as Row };
import _Col from './Col';
export { _Col as Col };
import _Navbar from './Navbar';
export { _Navbar as Navbar };
import _NavbarBrand from './NavbarBrand';
export { _NavbarBrand as NavbarBrand };
import _NavbarText from './NavbarText';
export { _NavbarText as NavbarText };
import _NavbarToggler from './NavbarToggler';
export { _NavbarToggler as NavbarToggler };
import _Nav from './Nav';
export { _Nav as Nav };
import _NavItem from './NavItem';
export { _NavItem as NavItem };
import _NavLink from './NavLink';
export { _NavLink as NavLink };
(https://i.stack.imgur.com/fInzi.png)
I already tried to reinstall reactstrap but it didn’t work
2
Answers
I encountered the same issue. After a lot of tries on different things. I got a solution after changing the reactstrap version.
So far with two version it worked
I decided to stay with
10.0.1-release-v10.0.0-c659629.0
for now and its working okayI followed the instruction posted by Md. Minhaz Ahamed, but in my case I changed from version 9.1.8 of reactstrap to version 9.1.6 and it worked.