react-bootstrap-theme-switcher icon indicating copy to clipboard operation
react-bootstrap-theme-switcher copied to clipboard

Uncaught syntaxError: Unexpected token <

Open dBurnhamAZ opened this issue 7 years ago • 1 comments
trafficstars

Hello, I am 'really' new to React, but I would like to try out your Theme-switcher. I believe I'm setting it up correctly but I keep getting these error in jquery.min.js and bootstrap.min.js. Has there been any similar error familiar with these errors? (see attached) Sorry for a lack of further information. That's all I get.

uncaugth syntaxerror

dBurnhamAZ avatar Oct 22 '18 17:10 dBurnhamAZ

UPDATE: I'm really new at React but after a couple of weeks, I finally figured out why I was getting the above error. (Uncaught SyntaxError: unexpected Token<) To be a clearer than the instructions explain, there are four important steps to get this working.

  1. npm install react-bootstrap-theme-switcher
  2. npm install jquery@latest (this is one simple overlooked part I forgot)
  3. npm install copy-webpack-plugin
  4. add to webpack.config.dev.js (in my case like this) const CopyWebpackPlugin = require('copy-webpack-plugin'); AND 'module.export' plugins: [ new CopyWebpackPlugin([ { context: 'node_modules/react-bootstrap-theme-switcher/themes/', from: '**/*', to: 'themes/' } ], { copyUnmodified: true } ), ]

Now it's works every time for me to implement into any apps.

dBurnhamAZ avatar Nov 12 '18 23:11 dBurnhamAZ