Js files not found & what-input.js root is undefined

My .js files are placed at the end of default.html file, just before closing body. Tried all paths ({{root}}, …assets/ etc.) and still get many errors:

<body> {{> navbar}} {{!-- Pages you create in the src/pages/ folder are inserted here when the flattened page is created. --}} {{> body}}
<script type="text/javascript" src="assets/js/jquery.min.js"></script>
<script type="text/javascript" src="{{root}}assets/js/app.js"></script>
{{> footer2}}
  1. HTTP/1. 404 Not found

  2. The resource from “http://localhost:8000/assets/js/jquery.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff

  3. Uncaught TypeError: root is undefined
    webpackUniversalModuleDefinition what-input.js:15 (It is complaining that root is undefined)

    (function webpackUniversalModuleDefinition(root, factory) {
    if(typeof exports === ‘object’ && typeof module === ‘object’)
    module.exports = factory();
    else if(typeof define === ‘function’ && define.amd)
    define(“whatInput”, [], factory);
    else if(typeof exports === ‘object’)
    exports[“whatInput”] = factory();
    root[“whatInput”] = factory();

The paths are specified in config.yml file

Anyone? Any ideas please?

Did you place jquery.min.js in the assets folder of the build / generated files?

Thank you so much for your reply. I really appreciate it.

In the ‘dist’/ generated files directory there is app.js file that includes all the js & jquery (not beautified).
dist > assets > js > app.js

There is app.js file in my ‘src’ directory that includes just the initialization (src > assets > js > app.js):

import $ from 'jquery';
import 'what-input';
import "foundation-sites/js/foundation"
import { Dropdown, DropdownMenu } from 'foundation-sites';

window.jQuery = $;
require ('what-input');


Any suggestion is highly appreciated.

The config file is just for bundling the static assets.
And all dependencies including jQuery are bundled as app.js. So this is correct. You should check the paths. jQuery is not needed as extra file and is not in the assets folder by default (the dist one, not the src one).

The root helper variable is provided by panini / handlebars.
For me it looks like your project is not correctly configured / setup.