I am attempting to implement a progress bar in Laravel 5.6 using this specific progress bar library. The Progress.js documentation indicates that the following steps are necessary:
var ProgressBar = require('progressbar.js')
Within the default assets/js/bootstrap.js
file, I have included:
window._ = require('lodash');
window.Popper = require('popper.js').default;
window.ProgressBar = require('progressbar.js');
Despite this, I continue to receive the error message progressbar is undefined
when trying to utilize it on the frontend. Both Lodash and Popper are functioning correctly.
Upon hovering over
window.ProgressBar = require('progressbar.js');
in VCS, the following message is displayed:
Could not find a declaration file for module 'progressbar.js'.
'/Users/proevilz/sites/stream-raiders/node_modules/progressbar.js/src/main.js' implicitly has an 'any' type.
Attempt
if available, or create a new declaration (.d.ts) file withnpm install @types/progressbar.js
declare module 'progressbar.js';
Following the suggestion, I tried the command but received an error from NPM indicating the absence of types.
The content of main.js
includes:
module.exports = {
// Higher level API, various shaped progress bars
Line: require('./line'),
Circle: require('./circle'),
SemiCircle: require('./semicircle'),
// Lower level API for utilizing any SVG path
Path: require('./path'),
// Base-class for developing new custom shapes
// aligned with the API of built-in shapes
// Currently undocumented.
Shape: require('./shape'),
// Internal utilities, currently undocumented.
utils: require('./utils')
};
What could I be overlooking? Is it possible to integrate this library without directly referencing the progressbar.js
file in my HTML?