This makes me run into this error which is terrible and I am stuck right there. Tried adding babel-loader and she-bang loader in webpack.config.js but no help.
The error:
ERROR Failed to compile with 1 errors
error in ./node_modules/wow/lib/main.js
Module parse failed: Unexpected character '#' (1:0)
You may need an appropriate loader to handle this file type.
| #!/usr/bin/env node
| var com = require("./command.js");
|
Please save me someone. Help me get out of it and use js plugins with peace.
The error is just an example fow the ‘wow’ plugin. I am getting the same error for all of the plugins.
I recommend stepping back and looking at how each package wants you to import it, one at a time, by checking their documentation. For example, I believe Highcharts would be something like this:
Thanks Alot Matt. Read through your suggested links and got the plugins to work from common.js file.
So my common.js file now looks like:
import Wow from 'wow.js';
import 'chosen-js/chosen.jquery.min';
import 'parsleyjs/dist/parsley.min';
import Highcharts from 'highcharts/highcharts';
window.Highcharts = Highcharts;
import 'lazyload/lazyload.min';
import Mailcheck from 'mailcheck/src/mailcheck.min';
window.Mailcheck = Mailcheck;
export default {
init() {
// JavaScript to be fired on all pages
const wow = new Wow();
wow.init();
},
finalize() {
// JavaScript to be fired on all pages, after page specific JS is fired
},
};