After I imported the CSS file of bootstrap, the following error messages appeared in the construction project:
ERROR in ./src/util/bootstrap/bootstrap.min.css
Module parse failed: D:\eclipseWorkspace\mbos\mbos-portal\webContent\src\util\bootstrap\bootstrap.min.css Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected character '@' (1:0)
at Parser.pp$4.raise (D:\eclipseWorkspace\mbos\mbos-portal\webContent\node_modules\webpack\node_modules\acorn\dist\acorn.js:2221:15)
at Parser.pp$7.getTokenFromCode (D:\eclipseWorkspace\mbos\mbos-portal\webContent\node_modules\webpack\node_modules\acorn\dist\acorn.js:2756:10)
at Parser.pp$7.readToken (D:\eclipseWorkspace\mbos\mbos-portal\webContent\node_modules\webpack\node_modules\acorn\dist\acorn.js:2477:17)
at Parser.pp$7.nextToken (D:\eclipseWorkspace\mbos\mbos-portal\webContent\node_modules\webpack\node_modules\acorn\dist\acorn.js:2468:15)
The reason is that the CSS file contains the @ symbol, and the configuration file does not specify a loader for the CSS file,
Solution: specify loader for CSS file:
{
test: /\.css$/,
loader: 'style-loader!css-loader'
},
(a)’21442;’32771;65306;
styles.css Unexpected character’
Read More:
- Front end project runtime prompts syntax error: typeerror: token.type.endswith is not a function solution
- Front end Vue project operation error module build failed
- Nginx front end and back end separation + service cluster reverse proxy
- The back end cannot receive the parameters passed by the front end
- Solving syntax error: unexpected character after line continuation character
- Syntax error: unexpected character after line continuation character
- Decipher the evolutionary path of junior, middle and senior programmers (front end)
- Hide print button when printing page in front end
- Jsonformat annotation solves the problem of time format in the front end of localdatetime
- What are the web front end technologies? What are the differences between cookie and session
- Record a front end error net:: err_ HTTP2_ PROTOCOL_ ERROR 200
- The time of the time database displayed by the front end is inconsistent
- Nginx modifies the front end request size limit (413 request entity too large)
- Compiler error message: cs1056: unexpected character handling
- Syntax error: unexpected end of file problem [two solutions]
- ASP.NET How to deal with “unexpected character” when writing code
- Solve the problem of syntax error: unexpected end of file or syntax error near unexpected token ` fi ‘error
- Syntax error: unexpected token in uni app project compilation
- Solve the unexpected end of stream exception thrown by jedis
- [development experience] solution to unexpected syntax error: unexpected identifier in JSON parsing