Closed Tsyklop closed 5 years ago
who can help? what wrong?
In browser i get this error:
Uncaught Error: Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: E:\IDEA\mobils-chat-front-end-react-v1\node_modules\reactstrap\src\Container.js: Unexpected token (32:4)
[0m [90m 30 | [39m[0m
[0m [90m 31 | [39m [36mreturn[39m ([0m
[0m[31m[1m>[22m[39m[90m 32 | [39m [33m<[39m[33mTag[39m {[33m...[39mattributes} className[33m=[39m{classes} [33m/[39m[33m>[39m[0m
[0m [90m | [39m [31m[1m^[22m[39m[0m
[0m [90m 33 | [39m )[33m;[39m[0m
[0m [90m 34 | [39m}[33m;[39m[0m
[0m [90m 35 | [39m[0m
at Parser.raise (E:\IDEA\mobils-chat-front-end-react-v1\node_modules\@babel\parser\lib\index.js:3939:15)
at Parser.unexpected (E:\IDEA\mobils-chat-front-end-react-v1\node_modules\@babel\parser\lib\index.js:5248:16)
at Parser.parseExprAtom (E:\IDEA\mobils-chat-front-end-react-v1\node_modules\@babel\parser\lib\index.js:6328:20)
at Parser.parseExprSubscripts (E:\IDEA\mobils-chat-front-end-react-v1\node_modules\@babel\parser\lib\index.js:5924:21)
at Parser.parseMaybeUnary (E:\IDEA\mobils-chat-front-end-react-v1\node_modules\@babel\parser\lib\index.js:5903:21)
at Parser.parseExprOps (E:\IDEA\mobils-chat-front-end-react-v1\node_modules\@babel\parser\lib\index.js:5812:21)
at Parser.parseMaybeConditional (E:\IDEA\mobils-chat-front-end-react-v1\node_modules\@babel\parser\lib\index.js:5784:21)
at Parser.parseMaybeAssign (E:\IDEA\mobils-chat-front-end-react-v1\node_modules\@babel\parser\lib\index.js:5731:21)
at Parser.parseParenAndDistinguishExpression (E:\IDEA\mobils-chat-front-end-react-v1\node_modules\@babel\parser\lib\index.js:6482:28)
at Parser.parseExprAtom (E:\IDEA\mobils-chat-front-end-react-v1\node_modules\@babel\parser\lib\index.js:6284:21)
at Object../node_modules/reactstrap/src/Container.js (http://localhost:3000/static/js/1.chunk.js:47522:7)
at __webpack_require__ (http://localhost:3000/static/js/bundle.js:783:30)
at fn (http://localhost:3000/static/js/bundle.js:151:20)
at Module../node_modules/reactstrap/src/index.js (http://localhost:3000/static/js/1.chunk.js:48181:68)
at __webpack_require__ (http://localhost:3000/static/js/bundle.js:783:30)
at fn (http://localhost:3000/static/js/bundle.js:151:20)
at Module../src/components/admin/panel/AddSite.js (http://localhost:3000/static/js/main.chunk.js:296:72)
at __webpack_require__ (http://localhost:3000/static/js/bundle.js:783:30)
at fn (http://localhost:3000/static/js/bundle.js:151:20)
at Module../src/page/admin/PanelPage.js (http://localhost:3000/static/js/main.chunk.js:3540:90)
at __webpack_require__ (http://localhost:3000/static/js/bundle.js:783:30)
at fn (http://localhost:3000/static/js/bundle.js:151:20)
at Module../src/config/Config.js (http://localhost:3000/static/js/main.chunk.js:2112:79)
at __webpack_require__ (http://localhost:3000/static/js/bundle.js:783:30)
at fn (http://localhost:3000/static/js/bundle.js:151:20)
at Module../src/module/AdminModule.js (http://localhost:3000/static/js/main.chunk.js:2202:72)
at __webpack_require__ (http://localhost:3000/static/js/bundle.js:783:30)
at fn (http://localhost:3000/static/js/bundle.js:151:20)
at Module../src/app/App.js (http://localhost:3000/static/js/main.chunk.js:193:77)
at __webpack_require__ (http://localhost:3000/static/js/bundle.js:783:30)
at fn (http://localhost:3000/static/js/bundle.js:151:20)
at Module../src/index.js (http://localhost:3000/static/js/main.chunk.js:2170:66)
at __webpack_require__ (http://localhost:3000/static/js/bundle.js:783:30)
at fn (http://localhost:3000/static/js/bundle.js:151:20)
at Object.0 (http://localhost:3000/static/js/main.chunk.js:5056:18)
at __webpack_require__ (http://localhost:3000/static/js/bundle.js:783:30)
at checkDeferredModules (http://localhost:3000/static/js/bundle.js:46:23)
at Array.webpackJsonpCallback [as push] (http://localhost:3000/static/js/bundle.js:33:19)
at http://localhost:3000/static/js/main.chunk.js:1:57
Any news here? I'm getting the same error.
Any news here? I'm getting the same error.
https://stackoverflow.com/questions/53900426/strange-react-compiler-behavior
That the error occurs in ./node_modules/reactstrap/src/Alert.js
means that a component is imported from reactstrap/src/...
instead of reactstrap
(the latter points at reactstrap/dist/...).
The problem with importing from reactstrap/src
is that it contains code that needs to be transpiled. It shouldn't be imported without a good reason because projects are usually configured to not transpile modules from node_modules, this would result in overhead and potential problems. In an application generated by create-react-app, this cannot be changed without modifying Webpack configuration.
Incorrect imports like reactstrap/src/...
are often added by IDE auto-imports.
In case there's
import Alert from 'reactstrap/src/Alert.js';
import, it should be changed to
import { Alert } from 'reactstrap';
Issue description
Tabs
#6.5.0
umd/csj/es
#16.7.0
#4.1.3
What is happening?
I do the project on ReactJS. Put the reactstrap module for elements from bootstrap4.
I have reactstrap tabs. So it works. I wanted to transfer content for tabs into separate components. And here an error occurred during compilation Why?
What should be happening?
Expecting normal compilation and behavior.
Expected code:
Steps to reproduce issue
Error message in console
Code
package.json